Repository: mlajtos/L1 Branch: master Commit: b5b848d81a78 Files: 153 Total size: 3.7 MB Directory structure: gitextract_wp7vokyw/ ├── .babelrc ├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── GOAL.md ├── LICENSE ├── README.md ├── TODO.md ├── latest/ │ ├── 1.51c25ac0adacae5e02ff.worker.js │ ├── 4.js │ ├── 5.js │ ├── 51c25ac0adacae5e02ff.worker.js │ ├── 6.js │ ├── app.js │ ├── b339297726b01d858501.worker.js │ ├── editor.worker.js │ ├── hotReload.js │ ├── icons-24a6ef8280df161e3d389800fa2107ae/ │ │ ├── .cache │ │ ├── manifest.json │ │ └── manifest.webapp │ ├── index.html │ └── json.worker.js ├── package.json ├── src/ │ ├── __tests__/ │ │ └── 0-tensor_literals/ │ │ └── index.js │ ├── components/ │ │ ├── Board/ │ │ │ ├── Code/ │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── Error/ │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── Function/ │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── Markdown/ │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── Object/ │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── ObjectProperty/ │ │ │ │ └── index.js │ │ │ ├── Observable/ │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── Promise/ │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── PropertyWrapper/ │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── Scalar/ │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── Tensor/ │ │ │ │ ├── CanvasTensor/ │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.sass │ │ │ │ ├── Stats/ │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.sass │ │ │ │ ├── SvgTensor/ │ │ │ │ │ ├── index.js │ │ │ │ │ └── style.sass │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── Unknown/ │ │ │ │ ├── index.js │ │ │ │ └── style.sass │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Dataset/ │ │ │ └── index.js │ │ ├── Editor/ │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Evaluator/ │ │ │ └── index.js │ │ ├── Interpreter/ │ │ │ ├── index.js │ │ │ ├── modules/ │ │ │ │ ├── ActivationFunctions/ │ │ │ │ │ └── index.js │ │ │ │ ├── Arithmetics/ │ │ │ │ │ ├── Clip/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ └── index.js │ │ │ │ ├── Documentation/ │ │ │ │ │ ├── doc.md │ │ │ │ │ └── index.js │ │ │ │ ├── Generators/ │ │ │ │ │ ├── Eye/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── LinearSpace/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Ones/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Zeros/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ └── index.js │ │ │ │ ├── Meta/ │ │ │ │ │ ├── Expand/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Rank/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Reshape/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Reverse/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Shape/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Size/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Transpose/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ └── index.js │ │ │ │ ├── Mouse.js │ │ │ │ ├── Random/ │ │ │ │ │ ├── Normal/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Uniform/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ └── index.js │ │ │ │ ├── Reducers/ │ │ │ │ │ ├── Max/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Mean/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Min/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Product/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── Sum/ │ │ │ │ │ │ ├── doc.md │ │ │ │ │ │ └── index.js │ │ │ │ │ └── index.js │ │ │ │ ├── TensorOperators/ │ │ │ │ │ └── index.js │ │ │ │ └── Trigonometry/ │ │ │ │ └── index.js │ │ │ ├── rootEnvironment.js │ │ │ └── symbols.js │ │ ├── Interpreter_OLD/ │ │ │ ├── index.js │ │ │ ├── operators.js │ │ │ ├── runtimeEnvironment.js │ │ │ ├── symbols.js │ │ │ └── utils.js │ │ ├── MonacoEditor/ │ │ │ └── index.js │ │ ├── Panel/ │ │ │ ├── index.js │ │ │ └── style.sass │ │ ├── Parser/ │ │ │ ├── grammar.ohm │ │ │ ├── index.js │ │ │ └── semantics.js │ │ ├── Spinner/ │ │ │ ├── index.js │ │ │ └── style.sass │ │ └── Studio/ │ │ ├── hello-world.l1 │ │ ├── index.js │ │ ├── style.sass │ │ └── test.worker.js │ ├── gallery/ │ │ ├── README.md │ │ ├── future/ │ │ │ ├── functional_object.l1 │ │ │ └── interactive_tensors.l1 │ │ └── old/ │ │ ├── 0_helloWorld.l1 │ │ ├── 10_simple_model.js │ │ ├── 13_edge_detection_pipeline.l1 │ │ ├── 14_edge_detection_compressed.l1 │ │ ├── 18_average_digit.l1 │ │ ├── 19_nth_order_gradient.l1 │ │ ├── 20_maxPool_translation.l1 │ │ ├── 22_polynomial_regression.l1 │ │ ├── 23_regress_tensor.l1 │ │ ├── 23_sine_exp.l1 │ │ ├── 24_RankDown.l1 │ │ ├── 24_cascade.l1 │ │ ├── 27_coffee.l1 │ │ ├── 5_tile_design.l1 │ │ ├── 6_random_test.l1 │ │ ├── 7_edge_detection.l1 │ │ └── 9_higher-order_fns.l1 │ ├── index.html │ ├── index.js │ └── test.js └── webpack.config.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .babelrc ================================================ { "env": { "development": { "presets": [ ["@babel/env", { "targets": { "browsers": [ ">1%", "not ie 11", "not op_mini all" ] }, "modules": false, "useBuiltIns": "entry" }], "@babel/react" ], "plugins": [ ["@babel/plugin-proposal-unicode-property-regex", { "useUnicodeFlag": false }], ["@babel/plugin-transform-runtime", { "polyfill": false, "regenerator": true }], ["@babel/plugin-proposal-class-properties"], ["@babel/plugin-syntax-dynamic-import"] ] } } } ================================================ FILE: .gitattributes ================================================ # Auto detect text files and perform LF normalization * text=auto ================================================ FILE: .gitignore ================================================ node_modules/ *.log ================================================ FILE: CHANGELOG.md ================================================ # Changelog ## August 2018 ### Tensor visualization * tensors with a small number of elements display also individual values ### Language * unary `+` as the Sum operator * unary `*` as the Product operator * multiline strings are dedented by default (as in Swift) ### API * [Clip](https://mlajtos.github.io/L1/latest/#OjpDbGlw), [Sum](https://mlajtos.github.io/L1/latest/#OjpTdW0=), [Transpose](https://mlajtos.github.io/L1/latest/#OjpUcmFuc3Bvc2U=), [Product](https://mlajtos.github.io/L1/latest/#OjpQcm9kdWN0), [Reverse](https://mlajtos.github.io/L1/latest/#OjpSZXZlcnNl), [Expand](https://mlajtos.github.io/L1/latest/#OjpFeHBhbmQ=) ### Documentation * [Examples](https://github.com/mlajtos/L1/tree/master/src/gallery) are back! * code snippets are easily runnable * wrote about [goals of L1](GOAL.md) ### Playground * shareable hyperlinks (Ctrl+S, Cmd-S) ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing Pull requests are welcome. ## Setup 1. ```git clone https://github.com/mlajtos/L1.git``` 1. ```cd L1``` 1. ```yarn``` ## Development 1. ```yarn run dev``` 1. http://localhost:7171 ## Build 1. ```yarn run build``` 1. ```yarn run serve``` 1. http://localhost:7171 Directory `L1/dist` contains built project. ================================================ FILE: GOAL.md ================================================ # Goal > **Become the standard tool for prototyping new Machine Learning ideas.** A bold goal, I know. But it means something different than what you might think. Many people interpret it as *"become the best Deep Learning framework"* or *"if PyTorch and TensorFlow had a baby"*. These statements would excite many professionals, but it would create only hype – vague and non-executable statement. Another formulation of the mentioned goal would be: > *Become the first choice tool for teaching and learning differentiable linear algebra.* This *italic* goal is borderline boring. But again, it is not meant as *"become the best numeric environment"* – whatever that might mean. Professionals are not the target audience here, but even they can benefit from this tool. However, L1 is not going to be the next TensorFlow, PyTorch, Mathematica, Jupyter Notebook, VS Code, TensorBoard, MATLAB, or anything. The intention is somewhere else. The ultimate goal of L1 is to be the medium for creative thought about specific subset of Machine Learning. ## Design goals To express more directly what L1 wants to be, is to present the driving principles behind it and how they are manifested in the implementation. *(This is not an exhaustive list.)* ### Minimal When yor mind is in the [Flow state](https://en.wikipedia.org/wiki/Flow_(psychology)) during programming, usually you don't want to think about type declarations, or match opening and closing parentheses that are deeply nested, or recasting int16 to float32, or using print statement for every step of your algorithm... These are the non-essential (boring) parts of the programming. L1 is not going to be all-encompassing IDE that covers everything in between data scraping to production deployment. It isn't even about the model creation... The focus is to lose all non-essential parts of the accidental complexities that accumulated in the history of programming, and present what's left in the purest form possible. ### Unified Design is an instance of the multi-variate optimization process. When you push in somewhere, something will pop out at the other side. By optimizing all the parameters at the same time, there is a temporal advantage. In other words, designing an IDE, a language and an API in unison, we can speed up the development of the whole thing. This method was principal in the early history of computing. For example, research that led to [Xerox Alto](http://worrydream.com/EarlyHistoryOfSmalltalk/) has been done all from scratch and in parallel – hardware, software, operating system, networking, graphics, programming language. There was no other way to it. L1 draws on this principle and strives to be *the whole experience*. It is not an IDE, not a language, not an API. One without the other is nothing. ### Familiar The large part of learning curve is dictated by the knowledge you already have. Humans employ transfer-learning across different, and quite often very distant tasks. For example, the Desktop metaphor of the graphical user interface, exploit our knowledge about the real (physical) desks and objects on them, to quickly learn how to operate an alien calculator. The famous programming language by Kenneth Iverson – APL – was anything but familiar. Extremely powerful, but alien. On the other hand, FORTRAN was lesser of the two, but it was familiar to mathematicians, so they could be productive without the steep learning curve. The L1 language reads like clean JSON with expressions. This combination is extremely simplistic, but still powerful – and above all – very familiar. More about that in part [Better JavaScript](#better-javascript) ### Interactive Writing a computer code without actually seeing what it does in real-time is a sin. Programming with live feedback keeps the user engaged and not frustrated by waiting for the manual edit-compile-run cycle. Nobody would ever want to draw with a pencil on a paper with their eyes closed, and only after that look at the drawing. Programming should be like drawing with your eyes open. L1 aspires to be a smooth live programming experience where you actually forget that you are programming. Immediate feedback matters. ## Better JavaScript Syntax and semantics of L1 language is heavily inspired by its host language – JavaScript. The main designing force is to simplify JS to the extreme – throw out everything that is non-essential. JavaScript is frozen to be backward compatible, so it will only grow in size, so adding new stuff in a proper way is hard or impossible. L1 is the opposite. ### Const by default Assignment is done by colon, because you are really creating an object with named properties. As in Python. ```js // JS const a = 23 ``` ```L1 ; L1 a: 23 ``` ### References Following example just adds one number to the other using a reference: ```js const a = 23 const b = a + 24 ``` ```L1 a: 23 b: a + 24 ``` However, if you want to do it in the object, you are out of luck: ```js const obj = { a: 23, b: this.a + 24 // obj.b is NaN, no Error! } ``` But this is totally normal thing in L1: ```L1 obj: { a: 23 b: a + 24 ; obj.b is 47 } ``` ### Referential transparency Take this example: ```js const obj = { a: 23 } const b = obj.a // b is 23, nice ``` Substituting `obj` for its value should still work: ```js const b = { a: 23 }.a // Oops, SyntaxError: Unexpected token . ``` You have to enclose it in parens: ```js const b = ({ a: 23 }).a ``` In L1 this works: ```L1 b: { a: 23 }.a ``` ### Function duality ES6 arrow functions (lambdas) are the most usefull thing added to JS: ```js const fn = a => a + 1 // function definition const x = fn(22) // function application ``` There is really no striking difference to L1: ```L1 fn: a => a + 1 ; function definition x: fn(22) ; function application ``` However the second best thing that would be added to JS is pipeline operator: ```js const x = 22 |> fn ``` In L1, pipeline operator makes a bit more sense: ```L1 x: 22 -> fn ``` ### Parens again Lets use arrow function to return an object: ```js const fn = a => { mu: 23 + a } const obj = fn(24) // undefined ``` `obj` is `undefined`. WAT?! You created a function body with a label instead of a object literal. Just use parens: ```js const fn = a => ({ mu: 23 + a }) const obj = fn(24) ``` No such surprise in L1: ```L1 fn: a => { mu: 23 + a } obj: fn(24) ``` Actually in L1 you can drop parens even from the function application: ```L1 obj: fn 24 ``` In L1 parens are only grouping things together – no other hidden meaning. ### Synergies When you combine these techniques together, you can do something silly as this: ```js const fn = a => { const b = a + 12 const c = b * 2 return { a, b, c } } const mu = fn(23) ``` In L1 this is a bit more straightforward: ```L1 fn: a => { a: a b: a + 12 c: b * 2 } mu: fn 23 ``` Even on the silly example, there is a modest gain in readability: * **JS:** 87 characters * including 23 white space characters * **L1:** 44 characters * including 15 white space characters ### Object as a function JS proxies are going to let you do magical (read: meta) things with objects. However, you will never be able to do this beautiful thing from Python: ```python class ObjClass(object): a = 23 def __call__(self, b): return self.a + b obj = ObjClass() mu = obj(24) ``` JS: ```js // don't even try ``` In L1 this is embarrassingly trivial: ```L1 obj: { a: 23 #call: b => a + b } mu: obj 24 ``` ### Documentation Have you ever seen documentation in JS? Not on a web, but in JS. You know, as in Python's `help()`. Documentation should be as close to code as possible. Example from Python: ```python def fn(a): """increments a provided number""" return a + 1 help(fn) # print(fn.__doc__) ``` Add some Markdown and you have something good: ```L1 fn: { #doc: " # Incrementer *Increments* a provided number by 1. Example: mu: fn 22 " #call: a => a + 1 } ``` ### Observables `Promise` is a future value that resolves or fails. `Observable` is a Promise that can resolve multiple times, so an asynchronous data stream. Observables will probably end up in JS and will superseed Promises as a standard way for dealing with asynchronous programming. Incorporating Observables into a language is therefore a must to have feature. In vanilla JS, when you want to track `x`-coordinate of a mouse and do something with that value you would go something like this: ```js var mu = 0 const onMouseXChanged = (value) => { mu = value * 10 } document.addEventListener("mousemove", (e) => onMouseXChanged(e.screenX)) ``` This is a classic Observer pattern and it is a really useful in real world applications. However it is cumbersome and does not scale really well. People created libraries like [RxJS](https://rxjs-dev.firebaseapp.com/) to deal with Observers and Observables in a better way. But this useful patern should be used on a language level, not as a library. Instead, one should be able to write following one-liner: ```L1 mu: Mouse.x * 10 ``` This way, `mu` will always be synchronized to the `x`-coordinate of the mouse. And of course subsequent computations dependent on `mu` will also be recalculated whenever is needed. ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2018 Milan Lajtoš Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # L1: Tensor Studio [L1: Tensor Studio](https://mlajtos.github.io/L1/latest/) is a live-programming environment for differentiable linear algebra. The playground for tensors. [![Screenshot](Screenshots/Screenshot4.png)](https://mlajtos.github.io/L1/latest/)

Live Demo | Documentation | Examples

## About L1 is a playground for differentiable linear algebra, heavily used in Machine Learning. It frees your mind from accidental complexities of programming, and lets you focus your attention on the underlying math to further strengthen your intuition. ### Goal Become the standard tool for prototyping new Machine Learning ideas. [More...](GOAL.md) ### Features * designed for rapid learning and prototyping * helpful live visualization * elegant pure functional language * eager execution * auto-broadcast for tensor operations * fast GPU-accelerated computation * awesome built-in documentation * syntax-highlighting and code-completion ### Changelog * [August 2018](CHANGELOG.md#august-2018) ### What's comming? * variable tensors and optimization * richer set of operators * pre-trained models * loading data, I/O * [etc.](https://github.com/mlajtos/L1/blob/master/TODO.md) ### Issues * None of the mobile browsers are supported * Firefox is rather slow and has unpredictable behavior – [#3](https://github.com/mlajtos/L1/issues/3) * please use Chrome for best experience * Edge looks visually off, but works OK ### Contribution Any form of help and feedback is welcome – including [PRs](CONTRIBUTING.md), [reporting bugs](https://github.com/mlajtos/L1/issues/new), [suggesting ideas](https://github.com/mlajtos/L1/issues/new), [shooting down existing ideas](TODO.md), [creating new examples](https://github.com/mlajtos/L1/tree/master/src/gallery), promotion, testing, etc. This project is under [MIT license](LICENSE). --- ## Thank you Big thank you to these great projects and awesome people behind them: - [TensorFlow.js](https://github.com/tensorflow/tfjs) - [Ohm](https://github.com/harc/ohm) - [Monaco Editor](https://github.com/Microsoft/monaco-editor) - [FiraCode](https://github.com/tonsky/FiraCode) - [React](https://github.com/facebook/react) - [RxJS](https://github.com/Reactive-Extensions/RxJS) - etc. This thing is stealing great ideas from: - [APL family](https://en.wikipedia.org/wiki/APL_(programming_language)) – A, [J](https://en.wikipedia.org/wiki/J_(programming_language)), K, Q - [LISP family](https://en.wikipedia.org/wiki/Lisp_(programming_language)) – ClojureScript - [ECMAScript](https://en.wikipedia.org/wiki/JavaScript) - [QML](https://en.m.wikipedia.org/wiki/QML) - [JSON](https://www.json.org/) - [Jsonnet](https://jsonnet.org/) – [Ren](https://pointillistic.com/ren/) - [Haskell](https://en.wikipedia.org/wiki/Haskell_(programming_language)) - [Smalltalk](https://en.wikipedia.org/wiki/Smalltalk) - [Moniel](https://github.com/mlajtos/moniel) – prototype of L1 - [Douglas Crockford](https://www.youtube.com/watch?v=NPB34lDZj3E) - [Bret Victor](https://vimeo.com/36579366) - etc. ================================================ FILE: TODO.md ================================================ # TODO ## Demos 1. Tile design – gallery/5_tile_design.l1 * needed functions: 1. Tile 1. GetDigit 1. Other * Iota * RankUp, RankDown * ArgMin, ArgMax * StochasticGradientDescent * Gradient * Flow ## Language * Operators for tensor * equal = == * not equal != * less than < * more than > * less than or equal <= * more than or equal >= ## Wholeness 1. Prelude * because many things can be written in L1 1. Traditional visualizations * Plots * What is the best plotting library? * should be able to continuously redraw itself with new data * What does TensorBoard use? * line, bar, scatter, ..? * `BarChart [0 1 2 3 4 5]` * `LineChart [0 1 2 3 4 5]` * `ScatterPlot [0 0, 1 1, 2 2, 3 3]` or `[0 1 2 3, 0 1 2 3]` * `BarChart [0 1 2, 3 4 5]` * `Chart { ... }` 1. Router * Must be hierarchical * I don't know what that means right now. * Can target part of the "notebook"? * kind of relevant – import from other notebooks * `:: #L1.#myNotebook.#rev111.functionOfInterest` * `#L1` object will do the loading (maybe different name?) * "rev" as from "revision" is unique version of the notebook * content-hashes would be awesome, but ugly * automatic numbering? * user-defined version? 1. How to directly compare two tensors? * `a: Zeros [10], b: Ones [10] 1. How to visualize high-rank tensors? * 1D, 2D slices? ## UX 1. When there is a error, selection is not visible * clashes with more than one error on the line * grouping errors by line? 1. Code completion provider which takes rootEnvironment as the source 1. History * what must be preserved (in state obj): * scrollOffset in board * scrollOffset in editor * cursor position in editor 1. working links in Markdown 1. Broken visual cue for scrolling the board 1. Correspondence between code and visualization * Focus * What part of visualization was generated by which part of the code? * What code generates which part of the visualization? * mockup would help and can be a good start ## Crazy 1. silent assignment folded by default? 1. Markdown for error messages 1. KaTeX for Markdown * would be super-convenient 1. Name resolution * Capitalized names could be resolved from root * or non-overideable through #meta * Capitalized names could be resolved by abbreviations (as in Moniel) 1. Tensors should be callable – indexing * `a: [1 2 3], c: a[0] ; c = 1 :D` * this way the second tensor is an address to the first one * `source: [1 2, 3 4], indices: [0 0, 1 1], result: source(indices) ; result = [1 4]` * this is the real shit! * (and `@` can stay for matmul, yay!) 1. `#render` (because of that "Can I create AI in HTML?" meme) ```L1 ; mu: { ; #render: props => ( ;
; {props.name} ; {props.surname} ;
; ) ; } mu: { #state: { name: "John" surname: "Doe" } #render: props => ( { tag: "div" content: { child1: { tag: "span" content: props.name } child2: { tag: "span" content: props.surname } } } ) #call: a => #render #state } hu: mu! ``` ## Random * ::Self should be ::RTFM * allow ! and () as a lambda argument? * :: with expression * eliminates cognitive friction * empty string as a key * (as a shorthand for #valueOf or #return?) * user cannot use it before naming it – good * is forced to have only one non-named prop – good ## Bugs * rendering an is leaking because Monaco does not notify DOMNode removal * report issue in Monaco GitHub? # Open questions ## How to mutate an existing object? 1. Is it even necessary? 1. Should it be allowed? 1. When is it a good idea? What about this? ```L1 Counter: { i: 0 increaseBy: x => { i: i + x increaseBy: x => { ; can't just ::increaseBy because of the wrong closure i: i + x } } } Counter: Counter.increaseBy 7 Counter: Counter.increaseBy 2 Counter: Counter.increaseBy 1 ; does not scale ; also, if Counter is shared, it won't work ``` ### State object One route may be having an explicit state object inside the normal object. State object could be mutated. However, there also needs to be a way to access parent/super/prototype object somehow... ```L1 Counter: { #state: { i: 0 } increaseBy: x => { #state.i: #state.i + x } } mu1: Counter.increaseBy 3 mu2: Counter.increaseBy 3 ``` Another approach: ```L1 Counter: { #state: { i: 0 ; internal fn ; #call: newState => () } increaseBy: x => #state { i: #state.i + x } } mu1: Counter.increaseBy 3 mu2: Counter.increaseBy 3 :: Counter.#state.i ``` So far, there should be a way to modify super/proto object. But then L1 cease to be pure. Object should not be changed directly from outside by force. But it should be able to change itself when asked nicely. ```L1 a: { b: 22 } ; a.b: 23 a: a.#mutate { b: 23 } ; looks really awful ``` # Links * [Haskell syntax](https://www.haskell.org/onlinereport/exps.html) * [Iterations in PEG](http://www.dalnefre.com/wp/2011/05/parsing-expression-grammars-part-4/) * [Continuations by example](http://matt.might.net/articles/programming-with-continuations--exceptions-backtracking-search-threads-generators-coroutines/) * [CPS in JS by example](http://matt.might.net/articles/by-example-continuation-passing-style/) * [EinSum](https://rockt.github.io/2018/04/30/einsum#fn.2) * [Firebase Cloud Fns](https://www.youtube.com/watch?v=prlK_QL_qOA) * [Something New](https://github.com/d-cook/SomethingNew) * [RxJS for mere mortal](https://stackoverflow.com/a/45227115) * [RxJS with React](https://medium.freecodecamp.org/how-to-build-a-github-search-in-react-with-rxjs-6-and-recompose-e9c6cc727e7f) * [hm](https://www.wired.com/2008/04/ff-wozniak/) * [geokit](https://rsnous.com/posts/notes-from-dynamicland-geokit/) * [Bohm](https://blogs.scientificamerican.com/cross-check/david-bohm-quantum-mechanics-and-enlightenment/) * [Kay](https://www.fastcompany.com/40435064/what-alan-kay-thinks-about-the-iphone-and-technology-now) * [Change detection](https://source.wustl.edu/2018/07/changedetection/) * [Notation](https://github.com/hypotext/notation) * [HCI](https://www.interaction-design.org/literature/book/the-encyclopedia-of-human-computer-interaction-2nd-ed) * [Mu](https://www.quantamagazine.org/to-remember-the-brain-must-actively-forget-20180724/) * [Mu2](https://blogs.scientificamerican.com/observations/brain-gain-a-person-can-instantly-blossom-into-a-savant-and-no-one-knows-why/) * [Mu3](https://qz.com/1116991/a-biologist-believes-that-trees-speak-a-language-we-can-learn/) ================================================ FILE: latest/1.51c25ac0adacae5e02ff.worker.js ================================================ this.webpackChunk([1],{5:function(n,o){function e(n){var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}e.keys=function(){return[]},e.resolve=e,n.exports=e,e.id=5}}); ================================================ FILE: latest/4.js ================================================ (this.webpackJsonp=this.webpackJsonp||[]).push([[4],{539:function(n,o){function e(n){var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}e.keys=function(){return[]},e.resolve=e,n.exports=e,e.id=539}}]); ================================================ FILE: latest/5.js ================================================ (this.webpackJsonp=this.webpackJsonp||[]).push([[5],{540:function(e,t,n){"use strict";n.r(t),n.d(t,"conf",function(){return o}),n.d(t,"language",function(){return c});var s="attribute.name.html";var o={comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">",notIn:["string"]}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"`",close:"`"}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e")}}},c={defaultToken:"",tokenPostfix:".md",control:/[\\`*_\[\]{}()#+\-\.!]/,noncontrol:/[^\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,jsescapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],tokenizer:{root:[[/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/,["white","keyword","keyword","keyword"]],[/^\s*(=+|\-+)\s*$/,"keyword"],[/^\s*((\*[ ]?)+)\s*$/,"meta.separator"],[/^\s*>+/,"comment"],[/^\s*([\*\-+:]|\d+\.)\s/,"keyword"],[/^(\t|[ ]{4})[^ ].*$/,"string"],[/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/,{token:"string",next:"@codeblock"}],[/^\s*```\s*((?:\w|[\/\-#])+)\s*$/,{token:"string",next:"@codeblockgh",nextEmbedded:"$1"}],[/^\s*```\s*$/,{token:"string",next:"@codeblock"}],{include:"@linecontent"}],codeblock:[[/^\s*~~~\s*$/,{token:"string",next:"@pop"}],[/^\s*```\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]],codeblockgh:[[/```\s*$/,{token:"variable.source",next:"@pop",nextEmbedded:"@pop"}],[/[^`]+/,"variable.source"]],linecontent:[[/&\w+;/,"string.escape"],[/@escapes/,"escape"],[/\b__([^\\_]|@escapes|_(?!_))+__\b/,"strong"],[/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/,"strong"],[/\b_[^_]+_\b/,"emphasis"],[/\*([^\\*]|@escapes)+\*/,"emphasis"],[/`([^\\`]|@escapes)+`/,"variable"],[/\{[^}]+\}/,"string.target"],[/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/,["string.link","","string.link"]],[/(!?\[)((?:[^\]\\]|@escapes)*)(\])/,"string.link"],{include:"html"}],html:[[/<(\w+)\/>/,"tag"],[/<(\w+)/,{cases:{"@empty":{token:"tag",next:"@tag.$1"},"@default":{token:"tag",next:"@tag.$1"}}}],[/<\/(\w+)\s*>/,{token:"tag"}],[//,"comment","@pop"],[//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=c(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=c(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=g({},t),t.gfm=g({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=c(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=g({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,i,o,s,a,u,l,c,h,d,p;for(e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(n&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),u={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},c=0;c ?/gm,""),this.token(o,n),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),p=(s=o[2]).length>1,this.tokens.push({type:"list_start",ordered:p,start:p?+s:""}),r=!1,d=(o=o[0].match(this.rules.item)).length,c=0;c1&&a.length>1||(e=o.slice(c+1).join("\n")+e,c=d-1)),i=r||/\n\n(?!\s*$)/.test(u),c!==d-1&&(r="\n"===u.charAt(u.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(u,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(n&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),o[3]&&(o[3]=o[3].substring(1,o[3].length-1)),h=o[1].toLowerCase(),this.tokens.links[h]||(this.tokens.links[h]={href:o[2],title:o[3]});else if(n&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),u={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},c=0;c])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function c(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function h(e,t){return d[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?d[" "+e]=e+"/":d[" "+e]=e.replace(/[^/]*$/,"")),e=d[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=c(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=c(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=c(r.reflink).replace("inside",r._inside).getRegex(),r.normal=g({},r),r.pedantic=g({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=g({},r.normal,{escape:c(r.escape).replace("])","~|])").getRegex(),url:c(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:c(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=g({},r.gfm,{br:c(r.br).replace("{2,}","*").getRegex(),text:c(r.gfm.text).replace("{2,}","*").getRegex()}),i.rules=r,i.output=function(e,t,n){return new i(t,n).output(e)},i.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),r="@"===i[2]?"mailto:"+(n=u(this.mangle(i[1]))):n=u(i[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):u(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(u(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(u(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else i[0]=this.rules._backpedal.exec(i[0])[0],e=e.substring(i[0].length),"@"===i[2]?r="mailto:"+(n=u(i[0])):(n=u(i[0]),r="www."===i[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},i.prototype.outputLink=function(e,t){var n=u(t.href),r=t.title?u(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,u(e[1]))},i.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},i.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},o.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
'+(n?e:u(e,!0))+"\n
\n":"
"+(n?e:u(e,!0))+"\n
"},o.prototype.blockquote=function(e){return"
\n"+e+"
\n"},o.prototype.html=function(e){return e},o.prototype.heading=function(e,t,n){return"'+e+"\n"},o.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},o.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},o.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},o.prototype.paragraph=function(e){return"

    "+e+"

    \n"},o.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},o.prototype.tablerow=function(e){return"\n"+e+"\n"},o.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},o.prototype.strong=function(e){return""+e+""},o.prototype.em=function(e){return""+e+""},o.prototype.codespan=function(e){return""+e+""},o.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},o.prototype.del=function(e){return""+e+""},o.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(l(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!p.test(e)&&(e=h(this.options.baseUrl,e));var i='
    "},o.prototype.image=function(e,t,n){this.options.baseUrl&&!p.test(e)&&(e=h(this.options.baseUrl,e));var r=''+n+'":">"},o.prototype.text=function(e){return e},s.prototype.strong=s.prototype.em=s.prototype.codespan=s.prototype.del=s.prototype.text=function(e){return e},s.prototype.link=s.prototype.image=function(e,t,n){return""+n},s.prototype.br=function(){return""},a.parse=function(e,t){return new a(t).parse(e)},a.prototype.parse=function(e){this.inline=new i(e.links,this.options),this.inlineText=new i(e.links,g({},this.options,{renderer:new s})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},a.prototype.next=function(){return this.token=this.tokens.pop()},a.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},a.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},a.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,l(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",o="";for(n="",e=0;eAn error occurred:

    "+u(e.message+"",!0)+"
    ";throw e}}f.exec=f,m.options=m.setOptions=function(e){return g(m.defaults,e),m},m.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new o,xhtml:!1,baseUrl:null},m.Parser=a,m.parser=a.parse,m.Renderer=o,m.TextRenderer=s,m.Lexer=n,m.lexer=n.lex,m.InlineLexer=i,m.inlineLexer=i.output,m.parse=m,Dw=m}).call(void 0);var Tw=Dw;Dw.Parser,Dw.parser,Dw.Renderer,Dw.TextRenderer,Dw.Lexer,Dw.lexer,Dw.InlineLexer,Dw.inlineLexer,Dw.parse;function Fw(e){var t=e.inline?"span":"div",n=document.createElement(t);return e.className&&(n.className=e.className),n}function Ow(e,t){void 0===t&&(t={});var n=Fw(t);return function e(t,n,r){var i;if(2===n.type)i=document.createTextNode(n.content);else if(3===n.type)i=document.createElement("b");else if(4===n.type)i=document.createElement("i");else if(5===n.type&&r){var o=document.createElement("a");o.href="#",r.disposeables.push(Tc(o,"click",function(e){r.callback(String(n.index),e)})),i=o}else 7===n.type?i=document.createElement("br"):1===n.type&&(i=t);t!==i&&t.appendChild(i);Array.isArray(n.children)&&n.children.forEach(function(t){e(i,t,r)})}(n,function(e){var t={type:1,children:[]},n=0,r=t,i=[],o=new Bw(e);for(;!o.eos();){var s=o.next(),a="\\"===s&&0!==Rw(o.peek());if(a&&(s=o.next()),a||0===Rw(s)||s!==o.peek())if("\n"===s)2===r.type&&(r=i.pop()),r.children.push({type:7});else if(2!==r.type){var u={type:2,content:s};r.children.push(u),i.push(r),r=u}else r.content+=s;else{o.advance(),2===r.type&&(r=i.pop());var l=Rw(s);if(r.type===l||5===r.type&&6===l)r=i.pop();else{var c={type:l,children:[]};5===l&&(c.index=n,n++),r.children.push(c),i.push(r),r=c}}}2===r.type&&(r=i.pop());i.length;return t}(e),t.actionHandler),n}function Pw(e,t){void 0===t&&(t={});var n,r=Fw(t),i=new Promise(function(e){return n=e}),o=new Tw.Renderer;o.image=function(e,t,n){var r=[];if(e){var i=e.split("|").map(function(e){return e.trim()});e=i[0];var o=i[1];if(o){var s=/height=(\d+)/.exec(o),a=/width=(\d+)/.exec(o),u=s&&s[1],l=a&&a[1],c=isFinite(parseInt(l)),h=isFinite(parseInt(u));c&&r.push('width="'+l+'"'),h&&r.push('height="'+u+'"')}}var d=[];return e&&d.push('src="'+e+'"'),n&&d.push('alt="'+n+'"'),t&&d.push('title="'+t+'"'),r.length&&(d=d.concat(r)),""},o.link=function(t,n,r){return t===r&&(r=kw(r)),n=kw(n),!(t=kw(t))||t.match(/^data:|javascript:/i)||t.match(/^command:/i)&&!e.isTrusted?r:'
    '+r+""},o.paragraph=function(e){return"

    "+e+"

    "},t.codeBlockRenderer&&(o.code=function(e,n){var o=t.codeBlockRenderer(n,e),s=xw.nextId(),a=Promise.all([o,i]).then(function(e){var t=e[0],n=r.querySelector('div[data-code="'+s+'"]');n&&(n.innerHTML=t)}).catch(function(e){});return t.codeBlockRenderCallback&&a.then(t.codeBlockRenderCallback),'
    '+et(e)+"
    "}),t.actionHandler&&t.actionHandler.disposeables.push(Tc(r,"click",function(e){var n=e.target;if("A"===n.tagName||(n=n.parentElement)&&"A"===n.tagName){var r=n.dataset.href;r&&t.actionHandler.callback(r,e)}}));var s={sanitize:!0,renderer:o};return r.innerHTML=Tw(e.value,s),n(),r}var Bw=function(){function e(e){this.source=e,this.index=0}return e.prototype.eos=function(){return this.index>=this.source.length},e.prototype.next=function(){var e=this.peek();return this.advance(),e},e.prototype.peek=function(){return this.source[this.index]},e.prototype.advance=function(){this.index++},e}();function Rw(e){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;default:return 0}}var jw,zw,Ww;n(341);function Vw(e){Hw(zw,e)}function Hw(e,t){jw&&(e.textContent===t&&(t=ns("repeated","{0} (occurred again)",t)),Dc(e),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible")}var Uw,Yw;n(342);!function(e){e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT"}(Uw||(Uw={})),function(e){e[e.BELOW=0]="BELOW",e[e.ABOVE=1]="ABOVE"}(Yw||(Yw={}));var Zw,Gw=function(){function e(e){var t=this;this.$view=Z_(".context-view").hide(),this.setContainer(e),this.toDispose=[{dispose:function(){t.setContainer(null)}}],this.toDisposeOnClean=null}return e.prototype.setContainer=function(t){var n=this;this.$container&&(this.$container.getHTMLElement().removeChild(this.$view.getHTMLElement()),this.$container.off(e.BUBBLE_UP_EVENTS),this.$container.off(e.BUBBLE_DOWN_EVENTS,!0),this.$container=null),t&&(this.$container=Z_(t),this.$view.appendTo(this.$container),this.$container.on(e.BUBBLE_UP_EVENTS,function(e){n.onDOMEvent(e,document.activeElement,!1)}),this.$container.on(e.BUBBLE_DOWN_EVENTS,function(e){n.onDOMEvent(e,document.activeElement,!0)},null,!0))},e.prototype.show=function(e){this.isVisible()&&this.hide(),this.$view.setClass("context-view").empty().style({top:"0px",left:"0px"}).show(),this.toDisposeOnClean=e.render(this.$view.getHTMLElement()),this.delegate=e,this.doLayout()},e.prototype.layout=function(){this.isVisible()&&(!1!==this.delegate.canRelayout?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())},e.prototype.doLayout=function(){var e,t=this.delegate.getAnchor();if(dh(t)){var n=eh(t);e={top:n.top,left:n.left,width:n.width,height:n.height}}else{var r=t;e={top:r.y,left:r.x,width:r.width||0,height:r.height||0}}var i={top:th.scrollY,left:th.scrollX,height:window.innerHeight,width:window.innerWidth},o=this.$view.getTotalSize(),s={width:o.width,height:o.height},a=this.delegate.anchorPosition||Yw.BELOW,u=this.delegate.anchorAlignment||Uw.LEFT,l=function(e,t,n,r,i){var o,s,a,u,l,c,h,d,p=function(e,t,n,r){return t?e:r?n:e},f=function(e,t,n,r,i){return i?p(e,t,n,r):p(n,r,e,t)};return{top:(o=t.top-e.height,s=t.top+t.height,a=o>=n.top&&o+e.height<=n.top+n.height,u=s>=n.top&&s+e.height<=n.top+n.height,f(o,a,s,u,r===Yw.ABOVE)),left:(l=t.left,c=t.left+t.width-e.width,h=l>=n.left&&l+e.width<=n.left+n.width,d=c>=n.left&&c+e.width<=n.left+n.width,f(l,h,c,d,i===Uw.LEFT))}}(s,e,i,a,u),c=eh(this.$container.getHTMLElement());l.top-=c.top,l.left-=c.left,this.$view.removeClass("top","bottom","left","right"),this.$view.addClass(a===Yw.BELOW?"bottom":"top"),this.$view.addClass(u===Uw.LEFT?"left":"right"),this.$view.style({top:l.top+"px",left:l.left+"px",width:"initial"})},e.prototype.hide=function(e){this.delegate&&this.delegate.onHide&&this.delegate.onHide(e),this.delegate=null,this.toDisposeOnClean&&(this.toDisposeOnClean.dispose(),this.toDisposeOnClean=null),this.$view.hide()},e.prototype.isVisible=function(){return!!this.delegate},e.prototype.onDOMEvent=function(e,t,n){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):n&&!sh(e.target,this.$container.getHTMLElement())&&this.hide())},e.prototype.dispose=function(){this.hide(),this.toDispose=on(this.toDispose)},e.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],e.BUBBLE_DOWN_EVENTS=["click"],e}(),Kw=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qw=bh;!function(e){e[e.INFO=1]="INFO",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR"}(Zw||(Zw={}));var Qw,Xw={inputBackground:md.fromHex("#3C3C3C"),inputForeground:md.fromHex("#CCCCCC"),inputValidationInfoBorder:md.fromHex("#55AAFF"),inputValidationInfoBackground:md.fromHex("#063B49"),inputValidationWarningBorder:md.fromHex("#B89500"),inputValidationWarningBackground:md.fromHex("#352A05"),inputValidationErrorBorder:md.fromHex("#BE1100"),inputValidationErrorBackground:md.fromHex("#5A1D1D")},Jw=function(e){function t(t,n,r){var i=e.call(this)||this;i.state="idle",i._onDidChange=i._register(new wn),i.onDidChange=i._onDidChange.event,i._onDidHeightChange=i._register(new wn),i.onDidHeightChange=i._onDidHeightChange.event,i.contextViewProvider=n,i.options=r||Object.create(null),ds(i.options,Xw,!1),i.message=null,i.cachedHeight=null,i.placeholder=i.options.placeholder||"",i.ariaLabel=i.options.ariaLabel||"",i.inputBackground=i.options.inputBackground,i.inputForeground=i.options.inputForeground,i.inputBorder=i.options.inputBorder,i.inputValidationInfoBorder=i.options.inputValidationInfoBorder,i.inputValidationInfoBackground=i.options.inputValidationInfoBackground,i.inputValidationWarningBorder=i.options.inputValidationWarningBorder,i.inputValidationWarningBackground=i.options.inputValidationWarningBackground,i.inputValidationErrorBorder=i.options.inputValidationErrorBorder,i.inputValidationErrorBackground=i.options.inputValidationErrorBackground,i.options.validationOptions&&(i.validation=i.options.validationOptions.validation),i.element=vh(t,qw(".monaco-inputbox.idle"));var o=i.options.flexibleHeight?"textarea":"input",s=vh(i.element,qw(".wrapper"));return i.input=vh(s,qw(o+".input")),i.input.setAttribute("autocorrect","off"),i.input.setAttribute("autocapitalize","off"),i.input.setAttribute("spellcheck","false"),i.onfocus(i.input,function(){return Mc(i.element,"synthetic-focus")}),i.onblur(i.input,function(){return Nc(i.element,"synthetic-focus")}),i.options.flexibleHeight?i.mirror=vh(s,qw("div.mirror")):(i.input.type=i.options.type||"text",i.input.setAttribute("wrap","off")),i.ariaLabel&&i.input.setAttribute("aria-label",i.ariaLabel),i.placeholder&&i.setPlaceHolder(i.placeholder),i.oninput(i.input,function(){return i.onValueChange()}),i.onblur(i.input,function(){return i.onBlur()}),i.onfocus(i.input,function(){return i.onFocus()}),i.placeholder&&Xl&&i.onclick(i.input,function(e){fh.stop(e,!0),i.input.focus()}),setTimeout(function(){i.input&&i.updateMirror()},0),i.options.actions&&(i.actionbar=i._register(new zC(i.element)),i.actionbar.push(i.options.actions,{icon:!0,label:!1})),i.applyStyles(),i}return Kw(t,e),t.prototype.onBlur=function(){this._hideMessage()},t.prototype.onFocus=function(){this._showMessage()},t.prototype.setPlaceHolder=function(e){this.input&&(this.input.setAttribute("placeholder",e),this.input.title=e)},t.prototype.setAriaLabel=function(e){this.ariaLabel=e,this.input&&(e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label"))},Object.defineProperty(t.prototype,"inputElement",{get:function(){return this.input},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.input.value},set:function(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return null===this.cachedHeight?oh(this.element):this.cachedHeight},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this.input.focus()},t.prototype.blur=function(){this.input.blur()},t.prototype.hasFocus=function(){return document.activeElement===this.input},t.prototype.select=function(e){void 0===e&&(e=null),this.input.select(),e&&this.input.setSelectionRange(e.start,e.end)},t.prototype.enable=function(){this.input.removeAttribute("disabled")},t.prototype.disable=function(){this.input.disabled=!0,this._hideMessage()},t.prototype.setEnabled=function(e){e?this.enable():this.disable()},Object.defineProperty(t.prototype,"width",{get:function(){return nh(this.input)},set:function(e){this.input.style.width=e+"px"},enumerable:!0,configurable:!0}),t.prototype.showMessage=function(e,t){this.message=e,Nc(this.element,"idle"),Nc(this.element,"info"),Nc(this.element,"warning"),Nc(this.element,"error"),Mc(this.element,this.classForType(e.type));var n=this.stylesForType(this.message.type);this.element.style.border=n.border?"1px solid "+n.border:null,Vw(e.type===Zw.ERROR?ns("alertErrorMessage","Error: {0}",e.content):e.type===Zw.WARNING?ns("alertWarningMessage","Warning: {0}",e.content):ns("alertInfoMessage","Info: {0}",e.content)),(this.hasFocus()||t)&&this._showMessage()},t.prototype.hideMessage=function(){this.message=null,Nc(this.element,"info"),Nc(this.element,"warning"),Nc(this.element,"error"),Mc(this.element,"idle"),this._hideMessage(),this.applyStyles()},t.prototype.isInputValid=function(){return!!this.validation&&!this.validation(this.value)},t.prototype.validate=function(){var e=null;return this.validation&&((e=this.validation(this.value))?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),!e},t.prototype.stylesForType=function(e){switch(e){case Zw.INFO:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground};case Zw.WARNING:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground}}},t.prototype.classForType=function(e){switch(e){case Zw.INFO:return"info";case Zw.WARNING:return"warning";default:return"error"}},t.prototype._showMessage=function(){var e=this;if(this.contextViewProvider&&this.message){var t,n=function(){return t.style.width=nh(e.element)+"px"};this.state="open",this.contextViewProvider.showContextView({getAnchor:function(){return e.element},anchorAlignment:Uw.RIGHT,render:function(r){t=vh(r,qw(".monaco-inputbox-container")),n();var i={inline:!0,className:"monaco-inputbox-message"},o=e.message.formatContent?Ow(e.message.content,i):function(e,t){void 0===t&&(t={});var n=Fw(t);return n.textContent=e,n}(e.message.content,i);Mc(o,e.classForType(e.message.type));var s=e.stylesForType(e.message.type);return o.style.backgroundColor=s.background?s.background.toString():null,o.style.border=s.border?"1px solid "+s.border:null,vh(t,o),null},layout:n})}},t.prototype._hideMessage=function(){this.contextViewProvider&&"open"===this.state&&(this.state="idle",this.contextViewProvider.hideContextView())},t.prototype.onValueChange=function(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),"open"===this.state&&this.contextViewProvider.layout()},t.prototype.updateMirror=function(){if(this.mirror){var e=this.value||this.placeholder,t=10===e.charCodeAt(e.length-1)?" ":"";this.mirror.textContent=e+t,this.layout()}},t.prototype.style=function(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()},t.prototype.applyStyles=function(){if(this.element){var e=this.inputBackground?this.inputBackground.toString():null,t=this.inputForeground?this.inputForeground.toString():null,n=this.inputBorder?this.inputBorder.toString():null;this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor=e,this.input.style.color=t,this.element.style.borderWidth=n?"1px":null,this.element.style.borderStyle=n?"solid":null,this.element.style.borderColor=n}},t.prototype.layout=function(){if(this.mirror){var e=this.cachedHeight;this.cachedHeight=oh(this.mirror),e!==this.cachedHeight&&(this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedHeight))}},t.prototype.dispose=function(){this._hideMessage(),this.element=null,this.input=null,this.contextViewProvider=null,this.message=null,this.placeholder=null,this.ariaLabel=null,this.validation=null,this.state=null,this.actionbar=null,e.prototype.dispose.call(this)},t}(eb),$w=(n(343),n(344),function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),eD={inputActiveOptionBorder:md.fromHex("#007ACC")},tD=function(e){function t(t){var n=e.call(this)||this;return n._opts=cs(t),ds(n._opts,eD,!1),n._checked=n._opts.isChecked,n.domNode=document.createElement("div"),n.domNode.title=n._opts.title,n.domNode.className="monaco-custom-checkbox "+n._opts.actionClassName+" "+(n._checked?"checked":"unchecked"),n.domNode.tabIndex=0,n.domNode.setAttribute("role","checkbox"),n.domNode.setAttribute("aria-checked",String(n._checked)),n.domNode.setAttribute("aria-label",n._opts.title),n.applyStyles(),n.onclick(n.domNode,function(e){n.checked=!n._checked,n._opts.onChange(!1),e.preventDefault()}),n.onkeydown(n.domNode,function(e){if(10===e.keyCode||3===e.keyCode)return n.checked=!n._checked,n._opts.onChange(!0),void e.preventDefault();n._opts.onKeyDown&&n._opts.onKeyDown(e)}),n}return $w(t,e),Object.defineProperty(t.prototype,"enabled",{get:function(){return"true"!==this.domNode.getAttribute("aria-disabled")},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this.domNode.focus()},Object.defineProperty(t.prototype,"checked",{get:function(){return this._checked},set:function(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this._checked?this.domNode.classList.add("checked"):this.domNode.classList.remove("checked"),this.applyStyles()},enumerable:!0,configurable:!0}),t.prototype.width=function(){return 22},t.prototype.style=function(e){e.inputActiveOptionBorder&&(this._opts.inputActiveOptionBorder=e.inputActiveOptionBorder),this.applyStyles()},t.prototype.applyStyles=function(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder?this._opts.inputActiveOptionBorder.toString():"transparent")},t.prototype.enable=function(){this.domNode.tabIndex=0,this.domNode.setAttribute("aria-disabled",String(!1))},t.prototype.disable=function(){wh(this.domNode),this.domNode.setAttribute("aria-disabled",String(!0))},t}(eb),nD=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rD=ns("caseDescription","Match Case"),iD=ns("wordsDescription","Match Whole Word"),oD=ns("regexDescription","Use Regular Expression"),sD=function(e){function t(t){return e.call(this,{actionClassName:"monaco-case-sensitive",title:rD+t.appendTitle,isChecked:t.isChecked,onChange:t.onChange,onKeyDown:t.onKeyDown,inputActiveOptionBorder:t.inputActiveOptionBorder})||this}return nD(t,e),t}(tD),aD=function(e){function t(t){return e.call(this,{actionClassName:"monaco-whole-word",title:iD+t.appendTitle,isChecked:t.isChecked,onChange:t.onChange,onKeyDown:t.onKeyDown,inputActiveOptionBorder:t.inputActiveOptionBorder})||this}return nD(t,e),t}(tD),uD=function(e){function t(t){return e.call(this,{actionClassName:"monaco-regex",title:oD+t.appendTitle,isChecked:t.isChecked,onChange:t.onChange,onKeyDown:t.onKeyDown,inputActiveOptionBorder:t.inputActiveOptionBorder})||this}return nD(t,e),t}(tD),lD=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cD=ns("defaultLabel","input"),hD=function(e){function t(t,n,r){var i=e.call(this)||this;return i._onDidOptionChange=i._register(new wn),i.onDidOptionChange=i._onDidOptionChange.event,i._onKeyDown=i._register(new wn),i.onKeyDown=i._onKeyDown.event,i._onMouseDown=i._register(new wn),i.onMouseDown=i._onMouseDown.event,i._onInput=i._register(new wn),i.onInput=i._onInput.event,i._onKeyUp=i._register(new wn),i.onKeyUp=i._onKeyUp.event,i._onCaseSensitiveKeyDown=i._register(new wn),i.onCaseSensitiveKeyDown=i._onCaseSensitiveKeyDown.event,i._lastHighlightFindOptions=0,i.contextViewProvider=n,i.width=r.width||100,i.placeholder=r.placeholder||"",i.validation=r.validation,i.label=r.label||cD,i.inputActiveOptionBorder=r.inputActiveOptionBorder,i.inputBackground=r.inputBackground,i.inputForeground=r.inputForeground,i.inputBorder=r.inputBorder,i.inputValidationInfoBorder=r.inputValidationInfoBorder,i.inputValidationInfoBackground=r.inputValidationInfoBackground,i.inputValidationWarningBorder=r.inputValidationWarningBorder,i.inputValidationWarningBackground=r.inputValidationWarningBackground,i.inputValidationErrorBorder=r.inputValidationErrorBorder,i.inputValidationErrorBackground=r.inputValidationErrorBackground,i.regex=null,i.wholeWords=null,i.caseSensitive=null,i.domNode=null,i.inputBox=null,i.buildDomNode(r.appendCaseSensitiveLabel||"",r.appendWholeWordsLabel||"",r.appendRegexLabel||""),Boolean(t)&&t.appendChild(i.domNode),i.onkeydown(i.inputBox.inputElement,function(e){return i._onKeyDown.fire(e)}),i.onkeyup(i.inputBox.inputElement,function(e){return i._onKeyUp.fire(e)}),i.oninput(i.inputBox.inputElement,function(e){return i._onInput.fire()}),i.onmousedown(i.inputBox.inputElement,function(e){return i._onMouseDown.fire(e)}),i}return lD(t,e),t.prototype.enable=function(){Nc(this.domNode,"disabled"),this.inputBox.enable(),this.regex.enable(),this.wholeWords.enable(),this.caseSensitive.enable()},t.prototype.disable=function(){Mc(this.domNode,"disabled"),this.inputBox.disable(),this.regex.disable(),this.wholeWords.disable(),this.caseSensitive.disable()},t.prototype.setEnabled=function(e){e?this.enable():this.disable()},t.prototype.clear=function(){this.clearValidation(),this.setValue(""),this.focus()},t.prototype.setWidth=function(e){this.width=e,this.domNode.style.width=this.width+"px",this.contextViewProvider.layout(),this.setInputWidth()},t.prototype.getValue=function(){return this.inputBox.value},t.prototype.setValue=function(e){this.inputBox.value!==e&&(this.inputBox.value=e)},t.prototype.style=function(e){this.inputActiveOptionBorder=e.inputActiveOptionBorder,this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()},t.prototype.applyStyles=function(){if(this.domNode){var e={inputActiveOptionBorder:this.inputActiveOptionBorder};this.regex.style(e),this.wholeWords.style(e),this.caseSensitive.style(e);var t={inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorBorder:this.inputValidationErrorBorder};this.inputBox.style(t)}},t.prototype.select=function(){this.inputBox.select()},t.prototype.focus=function(){this.inputBox.focus()},t.prototype.getCaseSensitive=function(){return this.caseSensitive.checked},t.prototype.setCaseSensitive=function(e){this.caseSensitive.checked=e,this.setInputWidth()},t.prototype.getWholeWords=function(){return this.wholeWords.checked},t.prototype.setWholeWords=function(e){this.wholeWords.checked=e,this.setInputWidth()},t.prototype.getRegex=function(){return this.regex.checked},t.prototype.setRegex=function(e){this.regex.checked=e,this.setInputWidth(),this.validate()},t.prototype.focusOnCaseSensitive=function(){this.caseSensitive.focus()},t.prototype.highlightFindOptions=function(){Nc(this.domNode,"highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,Mc(this.domNode,"highlight-"+this._lastHighlightFindOptions)},t.prototype.setInputWidth=function(){var e=this.width-this.caseSensitive.width()-this.wholeWords.width()-this.regex.width();this.inputBox.width=e},t.prototype.buildDomNode=function(e,t,n){var r=this;this.domNode=document.createElement("div"),this.domNode.style.width=this.width+"px",Mc(this.domNode,"monaco-findInput"),this.inputBox=this._register(new Jw(this.domNode,this.contextViewProvider,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation||null},inputBackground:this.inputBackground,inputForeground:this.inputForeground,inputBorder:this.inputBorder,inputValidationInfoBackground:this.inputValidationInfoBackground,inputValidationInfoBorder:this.inputValidationInfoBorder,inputValidationWarningBackground:this.inputValidationWarningBackground,inputValidationWarningBorder:this.inputValidationWarningBorder,inputValidationErrorBackground:this.inputValidationErrorBackground,inputValidationErrorBorder:this.inputValidationErrorBorder})),this.regex=this._register(new uD({appendTitle:n,isChecked:!1,onChange:function(e){r._onDidOptionChange.fire(e),e||r.inputBox.focus(),r.setInputWidth(),r.validate()},inputActiveOptionBorder:this.inputActiveOptionBorder})),this.wholeWords=this._register(new aD({appendTitle:t,isChecked:!1,onChange:function(e){r._onDidOptionChange.fire(e),e||r.inputBox.focus(),r.setInputWidth(),r.validate()},inputActiveOptionBorder:this.inputActiveOptionBorder})),this.caseSensitive=this._register(new sD({appendTitle:e,isChecked:!1,onChange:function(e){r._onDidOptionChange.fire(e),e||r.inputBox.focus(),r.setInputWidth(),r.validate()},onKeyDown:function(e){r._onCaseSensitiveKeyDown.fire(e)},inputActiveOptionBorder:this.inputActiveOptionBorder}));var i=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,function(e){if(e.equals(15)||e.equals(17)||e.equals(9)){var t=i.indexOf(document.activeElement);if(t>=0){var n=void 0;e.equals(17)?n=(t+1)%i.length:e.equals(15)&&(n=0===t?i.length-1:t-1),e.equals(9)?i[t].blur():n>=0&&i[n].focus(),fh.stop(e,!0)}}}),this.setInputWidth();var o=document.createElement("div");o.className="controls",o.appendChild(this.caseSensitive.domNode),o.appendChild(this.wholeWords.domNode),o.appendChild(this.regex.domNode),this.domNode.appendChild(o)},t.prototype.validate=function(){this.inputBox.validate()},t.prototype.showMessage=function(e){this.inputBox.showMessage(e)},t.prototype.clearMessage=function(){this.inputBox.hideMessage()},t.prototype.clearValidation=function(){this.inputBox.hideMessage()},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.OPTION_CHANGE="optionChange",t}(eb),dD=(n(345),function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}());!function(e){e[e.VERTICAL=0]="VERTICAL",e[e.HORIZONTAL=1]="HORIZONTAL"}(Qw||(Qw={}));var pD=function(){function e(e,t,n){void 0===n&&(n={});var r=this;this._onDidStart=new wn,this._onDidChange=new wn,this._onDidReset=new wn,this._onDidEnd=new wn,this.$e=Z_(".monaco-sash").appendTo(e),we.d&&this.$e.addClass("mac"),this.$e.on(ph.MOUSE_DOWN,function(e){r.onMouseDown(e)}),this.$e.on(ph.DBLCLICK,function(e){return r._onDidReset.fire()}),Im.addTarget(this.$e.getHTMLElement()),this.$e.on(Mm.Start,function(e){r.onTouchStart(e)}),this.size=n.baseSize||5,ic&&(this.size*=4,this.$e.addClass("touch")),this.setOrientation(n.orientation||Qw.VERTICAL),this.isDisabled=!1,this.hidden=!1,this.layoutProvider=t}return Object.defineProperty(e.prototype,"onDidStart",{get:function(){return this._onDidStart.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidReset",{get:function(){return this._onDidReset.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidEnd",{get:function(){return this._onDidEnd.event},enumerable:!0,configurable:!0}),e.prototype.setOrientation=function(e){this.orientation=e,this.$e.removeClass("horizontal","vertical"),this.$e.addClass(this.getOrientation()),this.orientation===Qw.HORIZONTAL?this.$e.size(null,this.size):this.$e.size(this.size),this.layoutProvider&&this.layout()},e.prototype.getOrientation=function(){return this.orientation===Qw.HORIZONTAL?"horizontal":"vertical"},e.prototype.onMouseDown=function(e){var t=this;if(fh.stop(e,!1),!this.isDisabled){var n=Z_(Dh("iframe"));n&&n.style("pointer-events","none");var r=new yc(e),i=r.posx,o=r.posy,s=r.altKey,a={startX:i,currentX:i,startY:o,currentY:o,altKey:s};this.$e.addClass("active"),this._onDidStart.fire(a);var u=Z_(window),l=uh(this.$e.getHTMLElement());this.orientation===Qw.HORIZONTAL?l.innerHTML="* { cursor: "+(we.d?"row-resize":"ns-resize")+"; }":l.innerHTML="* { cursor: "+(we.d?"col-resize":"ew-resize")+"; }",u.on("mousemove",function(e){fh.stop(e,!1);var n=new yc(e),r={startX:i,currentX:n.posx,startY:o,currentY:n.posy,altKey:s};t._onDidChange.fire(r)}).once("mouseup",function(e){fh.stop(e,!1),t.$e.getHTMLElement().removeChild(l),t.$e.removeClass("active"),t._onDidEnd.fire(),u.off("mousemove");var n=Z_(Dh("iframe"));n&&n.style("pointer-events","auto")})}},e.prototype.onTouchStart=function(e){var t=this;fh.stop(e);var n=[],r=e.pageX,i=e.pageY,o=e.altKey;this._onDidStart.fire({startX:r,currentX:r,startY:i,currentY:i,altKey:o}),n.push(kc(this.$e.getHTMLElement(),Mm.Change,function(e){Yr(e.pageX)&&Yr(e.pageY)&&t._onDidChange.fire({startX:r,currentX:e.pageX,startY:i,currentY:e.pageY,altKey:o})})),n.push(kc(this.$e.getHTMLElement(),Mm.End,function(e){t._onDidEnd.fire(),on(n)}))},e.prototype.layout=function(){var e;if(this.orientation===Qw.VERTICAL){var t=this.layoutProvider;e={left:t.getVerticalSashLeft(this)-this.size/2+"px"},t.getVerticalSashTop&&(e.top=t.getVerticalSashTop(this)+"px"),t.getVerticalSashHeight&&(e.height=t.getVerticalSashHeight(this)+"px")}else{var n=this.layoutProvider;e={top:n.getHorizontalSashTop(this)-this.size/2+"px"},n.getHorizontalSashLeft&&(e.left=n.getHorizontalSashLeft(this)+"px"),n.getHorizontalSashWidth&&(e.width=n.getHorizontalSashWidth(this)+"px")}this.$e.style(e)},e.prototype.show=function(){this.hidden=!1,this.$e.show()},e.prototype.hide=function(){this.hidden=!0,this.$e.hide()},e.prototype.isHidden=function(){return this.hidden},e.prototype.enable=function(){this.$e.removeClass("disabled"),this.isDisabled=!1},e.prototype.disable=function(){this.$e.addClass("disabled"),this.isDisabled=!0},Object.defineProperty(e.prototype,"enabled",{get:function(){return!this.isDisabled},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.$e&&(this.$e.destroy(),this.$e=null)},e}(),fD=(function(e){function t(t,n){var r=e.call(this)||this;return r.minWidth=n,r._onPositionChange=new wn,r.ratio=.5,r.sash=new pD(t,r),r._register(r.sash.onDidStart(function(){return r.onSashDragStart()})),r._register(r.sash.onDidChange(function(e){return r.onSashDrag(e)})),r._register(r.sash.onDidEnd(function(){return r.onSashDragEnd()})),r._register(r.sash.onDidReset(function(){return r.onSashReset()})),r}dD(t,e),Object.defineProperty(t.prototype,"onPositionChange",{get:function(){return this._onPositionChange.event},enumerable:!0,configurable:!0}),t.prototype.getVerticalSashTop=function(){return 0},t.prototype.getVerticalSashLeft=function(){return this.position},t.prototype.getVerticalSashHeight=function(){return this.dimension.height},t.prototype.setDimenesion=function(e){this.dimension=e,this.compute(this.ratio)},t.prototype.onSashDragStart=function(){this.startPosition=this.position},t.prototype.onSashDrag=function(e){this.compute((this.startPosition+(e.currentX-e.startX))/this.dimension.width)},t.prototype.compute=function(e){this.computeSashPosition(e),this.ratio=this.position/this.dimension.width,this._onPositionChange.fire(this.position)},t.prototype.onSashDragEnd=function(){this.sash.layout()},t.prototype.onSashReset=function(){this.compute(.5),this._onPositionChange.fire(this.position),this.sash.layout()},t.prototype.computeSashPosition=function(e){void 0===e&&(e=this.ratio);var t=this.dimension.width,n=Math.floor((e||.5)*t),r=Math.floor(.5*t);t>2*this.minWidth?(nt-this.minWidth&&(n=t-this.minWidth)):n=r,this.position!==n&&(this.position=n,this.sash.layout())}}(un),function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),gD=ns("label.find","Find"),mD=ns("placeholder.find","Find"),vD=ns("label.previousMatchButton","Previous match"),yD=ns("label.nextMatchButton","Next match"),bD=ns("label.toggleSelectionFind","Find in selection"),_D=ns("label.closeButton","Close"),CD=ns("label.replace","Replace"),wD=ns("placeholder.replace","Replace"),DD=ns("label.replaceButton","Replace"),ED=ns("label.replaceAllButton","Replace All"),AD=ns("label.toggleReplaceButton","Toggle Replace mode"),SD=ns("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",19999),xD=ns("label.matchesLocation","{0} of {1}"),MD=ns("label.noResults","No Results"),ND=69,ID=17+(ND+3+1)+92+2,LD=34,kD=function(){return function(e){this.afterLineNumber=e,this.heightInPx=LD,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}(),TD=function(e){function t(t,n,r,i,o,s,a){var u=e.call(this)||this;return u._codeEditor=t,u._controller=n,u._state=r,u._contextViewProvider=i,u._keybindingService=o,u._isVisible=!1,u._isReplaceVisible=!1,u._register(u._state.onFindReplaceStateChange(function(e){return u._onStateChanged(e)})),u._buildDomNode(),u._updateButtons(),u._tryUpdateWidgetWidth(),u._register(u._codeEditor.onDidChangeConfiguration(function(e){e.readOnly&&(u._codeEditor.getConfiguration().readOnly&&u._state.change({isReplaceRevealed:!1},!1),u._updateButtons()),e.layoutInfo&&u._tryUpdateWidgetWidth()})),u._register(u._codeEditor.onDidChangeCursorSelection(function(){u._isVisible&&u._updateToggleSelectionFindButton()})),u._register(u._codeEditor.onDidFocusEditor(function(){if(u._isVisible){var e=u._controller.getGlobalBufferTerm();e&&e!==u._state.searchString&&(u._state.change({searchString:e},!0),u._findInput.select())}})),u._findInputFocused=dw.bindTo(s),u._findFocusTracker=u._register(mh(u._findInput.inputBox.inputElement)),u._register(u._findFocusTracker.onDidFocus(function(){u._findInputFocused.set(!0),u._updateSearchScope()})),u._register(u._findFocusTracker.onDidBlur(function(){u._findInputFocused.set(!1)})),u._replaceInputFocused=pw.bindTo(s),u._replaceFocusTracker=u._register(mh(u._replaceInputBox.inputElement)),u._register(u._replaceFocusTracker.onDidFocus(function(){u._replaceInputFocused.set(!0),u._updateSearchScope()})),u._register(u._replaceFocusTracker.onDidBlur(function(){u._replaceInputFocused.set(!1)})),u._codeEditor.addOverlayWidget(u),u._viewZone=new kD(0),u._applyTheme(a.getTheme()),u._register(a.onThemeChange(u._applyTheme.bind(u))),u._register(u._codeEditor.onDidChangeModel(function(e){u._isVisible&&void 0!==u._viewZoneId&&u._codeEditor.changeViewZones(function(e){e.removeZone(u._viewZoneId),u._viewZoneId=void 0})})),u._register(u._codeEditor.onDidScrollChange(function(e){e.scrollTopChanged?u._layoutViewZone():setTimeout(function(){u._layoutViewZone()},0)})),u}return fD(t,e),t.prototype.getId=function(){return t.ID},t.prototype.getDomNode=function(){return this._domNode},t.prototype.getPosition=function(){return this._isVisible?{preference:Ru.TOP_RIGHT_CORNER}:null},t.prototype._onStateChanged=function(e){if(e.searchString&&(this._findInput.setValue(this._state.searchString),this._updateButtons()),e.replaceString&&(this._replaceInputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal(!0):this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?this._codeEditor.getConfiguration().readOnly||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInputBox.width=this._findInput.inputBox.width,this._updateButtons()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){var t=this._state.searchString.length>0&&0===this._state.matchesCount;Ic(this._domNode,"no-results",t),this._updateMatchesCount()}(e.searchString||e.currentMatch)&&this._layoutViewZone()},t.prototype._updateMatchesCount=function(){var e;if(this._matchesCount.style.minWidth=ND+"px",this._state.matchesCount>=19999?this._matchesCount.title=SD:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild),this._state.matchesCount>0){var t=String(this._state.matchesCount);this._state.matchesCount>=19999&&(t+="+");var n=String(this._state.matchesPosition);"0"===n&&(n="?"),e=$e(xD,n,t)}else e=MD;this._matchesCount.appendChild(document.createTextNode(e)),ND=Math.max(ND,this._matchesCount.clientWidth)},t.prototype._updateToggleSelectionFindButton=function(){var e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),n=this._toggleSelectionFind.checked;this._toggleSelectionFind.setEnabled(this._isVisible&&(n||t))},t.prototype._updateButtons=function(){this._findInput.setEnabled(this._isVisible),this._replaceInputBox.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);var e=this._state.searchString.length>0;this._prevBtn.setEnabled(this._isVisible&&e),this._nextBtn.setEnabled(this._isVisible&&e),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),Ic(this._domNode,"replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("collapse",!this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("expand",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);var t=!this._codeEditor.getConfiguration().readOnly;this._toggleReplaceBtn.setEnabled(this._isVisible&&t)},t.prototype._reveal=function(e){var t=this;if(!this._isVisible){this._isVisible=!0;var n=this._codeEditor.getSelection();!!n&&(n.startLineNumber!==n.endLineNumber||n.startColumn!==n.endColumn)&&this._codeEditor.getConfiguration().contribInfo.find.autoFindInSelection?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._tryUpdateWidgetWidth(),this._updateButtons(),setTimeout(function(){Mc(t._domNode,"visible"),t._domNode.setAttribute("aria-hidden","false")},0),this._codeEditor.layoutOverlayWidget(this);var r=!0;if(this._codeEditor.getConfiguration().contribInfo.find.seedSearchStringFromSelection&&n){var i=eh(this._codeEditor.getDomNode()),o=this._codeEditor.getScrolledVisiblePosition(n.getStartPosition()),s=i.left+o.left;if(o.topn.startLineNumber&&(r=!1);var a=$c(this._domNode).left;s>a&&(r=!1);var u=this._codeEditor.getScrolledVisiblePosition(n.getEndPosition());i.left+u.left>a&&(r=!1)}}this._showViewZone(r)}},t.prototype._hide=function(e){var t=this;this._isVisible&&(this._isVisible=!1,this._updateButtons(),Nc(this._domNode,"visible"),this._domNode.setAttribute("aria-hidden","true"),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._codeEditor.changeViewZones(function(e){void 0!==t._viewZoneId&&(e.removeZone(t._viewZoneId),t._viewZoneId=void 0,t._codeEditor.setScrollTop(t._codeEditor.getScrollTop()-t._viewZone.heightInPx))}))},t.prototype._layoutViewZone=function(){var e=this;this._isVisible&&void 0===this._viewZoneId&&this._codeEditor.changeViewZones(function(t){e._state.isReplaceRevealed?e._viewZone.heightInPx=64:e._viewZone.heightInPx=LD,e._viewZoneId=t.addZone(e._viewZone),e._codeEditor.setScrollTop(e._codeEditor.getScrollTop()+e._viewZone.heightInPx)})},t.prototype._showViewZone=function(e){var t=this;void 0===e&&(e=!0),this._isVisible&&this._codeEditor.changeViewZones(function(n){var r=LD;void 0!==t._viewZoneId?(t._state.isReplaceRevealed?(t._viewZone.heightInPx=64,r=64-LD):(t._viewZone.heightInPx=LD,r=LD-64),n.removeZone(t._viewZoneId)):t._viewZone.heightInPx=LD,t._viewZoneId=n.addZone(t._viewZone),e&&t._codeEditor.setScrollTop(t._codeEditor.getScrollTop()+r)})},t.prototype._applyTheme=function(e){var t={inputActiveOptionBorder:e.getColor(Df),inputBackground:e.getColor(_f),inputForeground:e.getColor(Cf),inputBorder:e.getColor(wf),inputValidationInfoBackground:e.getColor(Ef),inputValidationInfoBorder:e.getColor(Af),inputValidationWarningBackground:e.getColor(Sf),inputValidationWarningBorder:e.getColor(xf),inputValidationErrorBackground:e.getColor(Mf),inputValidationErrorBorder:e.getColor(Nf)};this._findInput.style(t),this._replaceInputBox.style(t)},t.prototype._tryUpdateWidgetWidth=function(){if(this._isVisible){var e=this._codeEditor.getConfiguration().layoutInfo.width,t=this._codeEditor.getConfiguration().layoutInfo.minimapWidth,n=!1,r=!1,i=!1;if(this._resized)if(nh(this._domNode)>411)return this._domNode.style.maxWidth=e-28-t-15+"px",void(this._replaceInputBox.inputElement.style.width=nh(this._findInput.inputBox.inputElement)+"px");if(439+t>=e&&(r=!0),439+t-ND>=e&&(i=!0),439+t-ND>=e+50&&(n=!0),Ic(this._domNode,"collapsed-find-widget",n),Ic(this._domNode,"narrow-find-widget",i),Ic(this._domNode,"reduced-find-widget",r),i||n||(this._domNode.style.maxWidth=e-28-t-15+"px"),this._resized){var o=nh(this._findInput.inputBox.inputElement);o>0&&(this._replaceInputBox.inputElement.style.width=o+"px")}}},t.prototype.focusFindInput=function(){this._findInput.select(),this._findInput.focus()},t.prototype.focusReplaceInput=function(){this._replaceInputBox.select(),this._replaceInputBox.focus()},t.prototype.highlightFindOptions=function(){this._findInput.highlightFindOptions()},t.prototype._updateSearchScope=function(){if(this._toggleSelectionFind.checked){var e=this._codeEditor.getSelection();1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,1));var t=this._state.currentMatch;e.startLineNumber!==e.endLineNumber&&(be.equalsRange(e,t)||this._state.change({searchScope:e},!0))}},t.prototype._onFindInputMouseDown=function(e){e.middleButton&&e.stopPropagation()},t.prototype._onFindInputKeyDown=function(e){return e.equals(3)?(this._codeEditor.getAction(_w.NextMatchFindAction).run().done(null,pn),void e.preventDefault()):e.equals(1027)?(this._codeEditor.getAction(_w.PreviousMatchFindAction).run().done(null,pn),void e.preventDefault()):e.equals(2)?(this._isReplaceVisible?this._replaceInputBox.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):void 0},t.prototype._onReplaceInputKeyDown=function(e){return e.equals(3)?(this._controller.replace(),void e.preventDefault()):e.equals(2051)?(this._controller.replaceAll(),void e.preventDefault()):e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):void 0},t.prototype.getHorizontalSashTop=function(e){return 0},t.prototype.getHorizontalSashLeft=function(e){return 0},t.prototype.getHorizontalSashWidth=function(e){return 500},t.prototype._keybindingLabelFor=function(e){var t=this._keybindingService.lookupKeybinding(e);return t?" ("+t.getLabel()+")":""},t.prototype._buildFindPart=function(){var e=this;this._findInput=this._register(new hD(null,this._contextViewProvider,{width:221,label:gD,placeholder:mD,appendCaseSensitiveLabel:this._keybindingLabelFor(_w.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(_w.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(_w.ToggleRegexCommand),validation:function(t){if(0===t.length)return null;if(!e._findInput.getRegex())return null;try{return new RegExp(t),null}catch(e){return{content:e.message}}}})),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(function(t){return e._onFindInputKeyDown(t)})),this._register(this._findInput.onInput(function(){e._state.change({searchString:e._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(function(){e._state.change({isRegex:e._findInput.getRegex(),wholeWord:e._findInput.getWholeWords(),matchCase:e._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(function(t){t.equals(1026)&&e._isReplaceVisible&&(e._replaceInputBox.focus(),t.preventDefault())})),we.c&&this._register(this._findInput.onMouseDown(function(t){return e._onFindInputMouseDown(t)})),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new OD({label:vD+this._keybindingLabelFor(_w.PreviousMatchFindAction),className:"previous",onTrigger:function(){e._codeEditor.getAction(_w.PreviousMatchFindAction).run().done(null,pn)}})),this._nextBtn=this._register(new OD({label:yD+this._keybindingLabelFor(_w.NextMatchFindAction),className:"next",onTrigger:function(){e._codeEditor.getAction(_w.NextMatchFindAction).run().done(null,pn)}}));var t=document.createElement("div");return t.className="find-part",t.appendChild(this._findInput.domNode),t.appendChild(this._matchesCount),t.appendChild(this._prevBtn.domNode),t.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new FD({parent:t,title:bD+this._keybindingLabelFor(_w.ToggleSearchScopeCommand),onChange:function(){if(e._toggleSelectionFind.checked){var t=e._codeEditor.getSelection();1===t.endColumn&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,1)),t.isEmpty()||e._state.change({searchScope:t},!0)}else e._state.change({searchScope:null},!0)}})),this._closeBtn=this._register(new OD({label:_D+this._keybindingLabelFor(_w.CloseFindWidgetCommand),className:"close-fw",onTrigger:function(){e._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:function(t){t.equals(2)&&e._isReplaceVisible&&(e._replaceBtn.isEnabled()?e._replaceBtn.focus():e._codeEditor.focus(),t.preventDefault())}})),t.appendChild(this._closeBtn.domNode),t},t.prototype._buildReplacePart=function(){var e=this,t=document.createElement("div");t.className="replace-input",t.style.width="221px",this._replaceInputBox=this._register(new Jw(t,null,{ariaLabel:CD,placeholder:wD})),this._register(Tc(this._replaceInputBox.inputElement,"keydown",function(t){return e._onReplaceInputKeyDown(t)})),this._register(Tc(this._replaceInputBox.inputElement,"input",function(t){e._state.change({replaceString:e._replaceInputBox.value},!1)})),this._replaceBtn=this._register(new OD({label:DD+this._keybindingLabelFor(_w.ReplaceOneAction),className:"replace",onTrigger:function(){e._controller.replace()},onKeyDown:function(t){t.equals(1026)&&(e._closeBtn.focus(),t.preventDefault())}})),this._replaceAllBtn=this._register(new OD({label:ED+this._keybindingLabelFor(_w.ReplaceAllAction),className:"replace-all",onTrigger:function(){e._controller.replaceAll()}}));var n=document.createElement("div");return n.className="replace-part",n.appendChild(t),n.appendChild(this._replaceBtn.domNode),n.appendChild(this._replaceAllBtn.domNode),n},t.prototype._buildDomNode=function(){var e=this,t=this._buildFindPart(),n=this._buildReplacePart();this._toggleReplaceBtn=this._register(new OD({label:AD,className:"toggle left",onTrigger:function(){e._state.change({isReplaceRevealed:!e._isReplaceVisible},!1),e._isReplaceVisible&&(e._replaceInputBox.width=e._findInput.inputBox.width),e._showViewZone()}})),this._toggleReplaceBtn.toggleClass("expand",this._isReplaceVisible),this._toggleReplaceBtn.toggleClass("collapse",!this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.style.width="411px",this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(t),this._domNode.appendChild(n),this._buildSash()},t.prototype._buildSash=function(){var e=this;this._resizeSash=new pD(this._domNode,this,{orientation:Qw.VERTICAL}),this._resized=!1;var t=411;this._register(this._resizeSash.onDidStart(function(n){t=nh(e._domNode)})),this._register(this._resizeSash.onDidChange(function(n){e._resized=!0;var r=t+n.startX-n.currentX;if(!(r<411)){var i=r-ID;r>(parseFloat(Kc(e._domNode).maxWidth)||0)||(e._domNode.style.width=r+"px",e._isReplaceVisible&&(e._replaceInputBox.width=i))}}))},t.ID="editor.contrib.findWidget",t}(eb),FD=function(e){function t(n){var r=e.call(this)||this;return r._opts=n,r._domNode=document.createElement("div"),r._domNode.className="monaco-checkbox",r._domNode.title=r._opts.title,r._domNode.tabIndex=0,r._checkbox=document.createElement("input"),r._checkbox.type="checkbox",r._checkbox.className="checkbox",r._checkbox.id="checkbox-"+t._COUNTER++,r._checkbox.tabIndex=-1,r._label=document.createElement("label"),r._label.className="label",r._label.htmlFor=r._checkbox.id,r._label.tabIndex=-1,r._domNode.appendChild(r._checkbox),r._domNode.appendChild(r._label),r._opts.parent.appendChild(r._domNode),r.onchange(r._checkbox,function(e){r._opts.onChange()}),r}return fD(t,e),Object.defineProperty(t.prototype,"domNode",{get:function(){return this._domNode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"checked",{get:function(){return this._checkbox.checked},set:function(e){this._checkbox.checked=e},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this._checkbox.focus()},t.prototype.enable=function(){this._checkbox.removeAttribute("disabled")},t.prototype.disable=function(){this._checkbox.disabled=!0},t.prototype.setEnabled=function(e){e?(this.enable(),this.domNode.tabIndex=0):(this.disable(),this.domNode.tabIndex=-1)},t._COUNTER=0,t}(eb),OD=function(e){function t(t){var n=e.call(this)||this;return n._opts=t,n._domNode=document.createElement("div"),n._domNode.title=n._opts.label,n._domNode.tabIndex=0,n._domNode.className="button "+n._opts.className,n._domNode.setAttribute("role","button"),n._domNode.setAttribute("aria-label",n._opts.label),n.onclick(n._domNode,function(e){n._opts.onTrigger(),e.preventDefault()}),n.onkeydown(n._domNode,function(e){if(e.equals(10)||e.equals(3))return n._opts.onTrigger(),void e.preventDefault();n._opts.onKeyDown&&n._opts.onKeyDown(e)}),n}return fD(t,e),Object.defineProperty(t.prototype,"domNode",{get:function(){return this._domNode},enumerable:!0,configurable:!0}),t.prototype.isEnabled=function(){return this._domNode.tabIndex>=0},t.prototype.focus=function(){this._domNode.focus()},t.prototype.setEnabled=function(e){Ic(this._domNode,"disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1},t.prototype.setExpanded=function(e){this._domNode.setAttribute("aria-expanded",String(!!e))},t.prototype.toggleClass=function(e,t){Ic(this._domNode,e,t)},t}(eb);Vg(function(e,t){var n=function(e,n){n&&t.addRule(".monaco-editor "+e+" { background-color: "+n+"; }")};n(".findMatch",e.getColor(og)),n(".currentFindMatch",e.getColor(ig)),n(".findScope",e.getColor(sg)),n(".find-widget",e.getColor(Xf));var r=e.getColor(bf);r&&t.addRule(".monaco-editor .find-widget { box-shadow: 0 2px 8px "+r+"; }");var i=e.getColor(ug);i&&t.addRule(".monaco-editor .findMatch { border: 1px "+("hc"===e.type?"dotted":"solid")+" "+i+"; box-sizing: border-box; }");var o=e.getColor(ag);o&&t.addRule(".monaco-editor .currentFindMatch { border: 2px solid "+o+"; padding: 1px; box-sizing: border-box; }");var s=e.getColor(lg);s&&t.addRule(".monaco-editor .findScope { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+s+"; }");var a=e.getColor(gf);a&&t.addRule(".monaco-editor .find-widget { border: 2px solid "+a+"; }");var u=e.getColor(pf);u&&t.addRule(".monaco-editor .find-widget.no-results .matchesCount { color: "+u+"; }");var l=e.getColor(Jf);l&&t.addRule(".monaco-editor .find-widget .monaco-sash { background-color: "+l+"; width: 3px !important; margin-left: -4px;}")});var PD=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),BD=function(e){function t(t,n,r,i){var o=e.call(this)||this;o._hideSoon=o._register(new Yl(function(){return o._hide()},2e3)),o._isVisible=!1,o._editor=t,o._state=n,o._keybindingService=r,o._domNode=document.createElement("div"),o._domNode.className="findOptionsWidget",o._domNode.style.display="none",o._domNode.style.top="10px",o._domNode.setAttribute("role","presentation"),o._domNode.setAttribute("aria-hidden","true");var s=i.getTheme().getColor(Df);return o.caseSensitive=o._register(new sD({appendTitle:o._keybindingLabelFor(_w.ToggleCaseSensitiveCommand),isChecked:o._state.matchCase,onChange:function(e){o._state.change({matchCase:o.caseSensitive.checked},!1)},inputActiveOptionBorder:s})),o._domNode.appendChild(o.caseSensitive.domNode),o.wholeWords=o._register(new aD({appendTitle:o._keybindingLabelFor(_w.ToggleWholeWordCommand),isChecked:o._state.wholeWord,onChange:function(e){o._state.change({wholeWord:o.wholeWords.checked},!1)},inputActiveOptionBorder:s})),o._domNode.appendChild(o.wholeWords.domNode),o.regex=o._register(new uD({appendTitle:o._keybindingLabelFor(_w.ToggleRegexCommand),isChecked:o._state.isRegex,onChange:function(e){o._state.change({isRegex:o.regex.checked},!1)},inputActiveOptionBorder:s})),o._domNode.appendChild(o.regex.domNode),o._editor.addOverlayWidget(o),o._register(o._state.onFindReplaceStateChange(function(e){var t=!1;e.isRegex&&(o.regex.checked=o._state.isRegex,t=!0),e.wholeWord&&(o.wholeWords.checked=o._state.wholeWord,t=!0),e.matchCase&&(o.caseSensitive.checked=o._state.matchCase,t=!0),!o._state.isRevealed&&t&&o._revealTemporarily()})),o._register(Fc(o._domNode,function(e){return o._onMouseOut()})),o._register(kc(o._domNode,"mouseover",function(e){return o._onMouseOver()})),o._applyTheme(i.getTheme()),o._register(i.onThemeChange(o._applyTheme.bind(o))),o}return PD(t,e),t.prototype._keybindingLabelFor=function(e){var t=this._keybindingService.lookupKeybinding(e);return t?" ("+t.getLabel()+")":""},t.prototype.dispose=function(){this._editor.removeOverlayWidget(this),e.prototype.dispose.call(this)},t.prototype.getId=function(){return t.ID},t.prototype.getDomNode=function(){return this._domNode},t.prototype.getPosition=function(){return{preference:Ru.TOP_RIGHT_CORNER}},t.prototype.highlightFindOptions=function(){this._revealTemporarily()},t.prototype._revealTemporarily=function(){this._show(),this._hideSoon.schedule()},t.prototype._onMouseOut=function(){this._hideSoon.schedule()},t.prototype._onMouseOver=function(){this._hideSoon.cancel()},t.prototype._show=function(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")},t.prototype._hide=function(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")},t.prototype._applyTheme=function(e){var t={inputActiveOptionBorder:e.getColor(Df)};this.caseSensitive.style(t),this.wholeWords.style(t),this.regex.style(t)},t.ID="editor.contrib.findOptionsWidget",t}(eb);Vg(function(e,t){var n=e.getColor(Xf);n&&t.addRule(".monaco-editor .findOptionsWidget { background-color: "+n+"; }");var r=e.getColor(bf);r&&t.addRule(".monaco-editor .findOptionsWidget { box-shadow: 0 2px 8px "+r+"; }");var i=e.getColor(gf);i&&t.addRule(".monaco-editor .findOptionsWidget { border: 2px solid "+i+"; }")});var RD=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jD=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},zD=function(e,t){return function(n,r){t(n,r,e)}};function WD(e){var t=e.getSelection();if(t.startLineNumber===t.endLineNumber){if(!t.isEmpty())return e.getModel().getValueInRange(t);var n=e.getModel().getWordAtPosition(t.getStartPosition());if(n)return n.word}return null}var VD=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o._editor=t,o._findWidgetVisible=hw.bindTo(n),o._storageService=r,o._clipboardService=i,o._updateHistoryDelayer=new Rl(500),o._currentHistoryNavigator=new ow,o._state=o._register(new Ew),o.loadQueryState(),o._register(o._state.onFindReplaceStateChange(function(e){return o._onStateChanged(e)})),o._model=null,o._register(o._editor.onDidChangeModel(function(){var e=o._editor.getModel()&&o._state.isRevealed;o.disposeModel(),o._state.change({searchScope:null,matchCase:o._storageService.getBoolean("editor.matchCase",Pp.WORKSPACE,!1),wholeWord:o._storageService.getBoolean("editor.wholeWord",Pp.WORKSPACE,!1),isRegex:o._storageService.getBoolean("editor.isRegex",Pp.WORKSPACE,!1)},!1),e&&o._start({forceRevealReplace:!1,seedSearchStringFromSelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1})})),o}return RD(t,e),t.get=function(e){return e.getContribution(t.ID)},t.prototype.dispose=function(){this.disposeModel(),e.prototype.dispose.call(this)},t.prototype.disposeModel=function(){this._model&&(this._model.dispose(),this._model=null)},t.prototype.getId=function(){return t.ID},t.prototype._onStateChanged=function(e){this.saveQueryState(e),e.updateHistory&&e.searchString&&this._delayedUpdateHistory(),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)},t.prototype.saveQueryState=function(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,Pp.WORKSPACE),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,Pp.WORKSPACE),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,Pp.WORKSPACE)},t.prototype.loadQueryState=function(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",Pp.WORKSPACE,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",Pp.WORKSPACE,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",Pp.WORKSPACE,this._state.isRegex)},!1)},t.prototype._delayedUpdateHistory=function(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this))},t.prototype._updateHistory=function(){this._state.searchString&&this._currentHistoryNavigator.add(this._state.searchString)},t.prototype.getState=function(){return this._state},t.prototype.getHistory=function(){return this._currentHistoryNavigator},t.prototype.closeFindWidget=function(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()},t.prototype.toggleCaseSensitive=function(){this._state.change({matchCase:!this._state.matchCase},!1)},t.prototype.toggleWholeWords=function(){this._state.change({wholeWord:!this._state.wholeWord},!1)},t.prototype.toggleRegex=function(){this._state.change({isRegex:!this._state.isRegex},!1)},t.prototype.toggleSearchScope=function(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else{var e=this._editor.getSelection();1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,1)),e.isEmpty()||this._state.change({searchScope:e},!0)}},t.prototype.setSearchString=function(e){this._state.isRegex&&(e=tt(e)),this._state.change({searchString:e},!1)},t.prototype.highlightFindOptions=function(){},t.prototype._start=function(e){if(this.disposeModel(),this._editor.getModel()){var t,n={isRevealed:!0};if(e.seedSearchStringFromSelection)(t=WD(this._editor))&&(this._state.isRegex?n.searchString=tt(t):n.searchString=t);if(!n.searchString&&e.seedSearchStringFromGlobalClipboard)(t=this.getGlobalBufferTerm())&&(n.searchString=t);e.forceRevealReplace?n.isReplaceRevealed=!0:this._findWidgetVisible.get()||(n.isReplaceRevealed=!1),this._state.change(n,!1),this._model||(this._model=new Cw(this._editor,this._state))}},t.prototype.start=function(e){this._start(e)},t.prototype.moveToNextMatch=function(){return!!this._model&&(this._model.moveToNextMatch(),!0)},t.prototype.moveToPrevMatch=function(){return!!this._model&&(this._model.moveToPrevMatch(),!0)},t.prototype.replace=function(){return!!this._model&&(this._model.replace(),!0)},t.prototype.replaceAll=function(){return!!this._model&&(this._model.replaceAll(),!0)},t.prototype.selectAllMatches=function(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)},t.prototype.showPreviousFindTerm=function(){var e=this._currentHistoryNavigator.previous();return e&&this._state.change({searchString:e},!1,!1),!0},t.prototype.showNextFindTerm=function(){var e=this._currentHistoryNavigator.next();return e&&this._state.change({searchString:e},!1,!1),!0},t.prototype.getGlobalBufferTerm=function(){return this._editor.getConfiguration().contribInfo.find.globalFindClipboard&&this._clipboardService&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""},t.prototype.setGlobalBufferTerm=function(e){this._editor.getConfiguration().contribInfo.find.globalFindClipboard&&this._clipboardService&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)},t.ID="editor.contrib.findController",t=jD([zD(1,Su),zD(2,Bp),zD(3,Aw)],t)}(un),HD=function(e){function t(t,n,r,i,o,s,a){var u=e.call(this,t,r,s,a)||this;return u._contextViewService=n,u._contextKeyService=r,u._keybindingService=i,u._themeService=o,u}return RD(t,e),t.prototype._start=function(t){this._widget||this._createFindWidget(),e.prototype._start.call(this,t),2===t.shouldFocus?this._widget.focusReplaceInput():1===t.shouldFocus&&this._widget.focusFindInput()},t.prototype.highlightFindOptions=function(){this._widget||this._createFindWidget(),this._state.isRevealed?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()},t.prototype._createFindWidget=function(){this._widget=this._register(new TD(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService)),this._findOptionsWidget=this._register(new BD(this._editor,this._state,this._keybindingService,this._themeService))},t=jD([zD(1,WC),zD(2,Su),zD(3,HC),zD(4,Og),zD(5,Bp),zD(6,Pr(Aw))],t)}(VD),UD=function(e){function t(){return e.call(this,{id:_w.StartFindAction,label:ns("startFindAction","Find"),alias:"Find",precondition:null,kbOpts:{kbExpr:null,primary:2084}})||this}return RD(t,e),t.prototype.run=function(e,t){var n=VD.get(t);n&&n.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getConfiguration().contribInfo.find.globalFindClipboard,shouldFocus:1,shouldAnimate:!0})},t}(qu),YD=function(e){function t(){return e.call(this,{id:_w.StartFindWithSelection,label:ns("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:null,kbOpts:{kbExpr:null,primary:null,mac:{primary:2083}}})||this}return RD(t,e),t.prototype.run=function(e,t){var n=VD.get(t);n&&(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:!0,seedSearchStringFromGlobalClipboard:!1,shouldFocus:1,shouldAnimate:!0}),n.setGlobalBufferTerm(n.getState().searchString))},t}(qu),ZD=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return RD(t,e),t.prototype.run=function(e,t){var n=VD.get(t);n&&!this._run(n)&&(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===n.getState().searchString.length&&t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0}),this._run(n))},t}(qu),GD=function(e){function t(){return e.call(this,{id:_w.NextMatchFindAction,label:ns("findNextMatchAction","Find Next"),alias:"Find Next",precondition:null,kbOpts:{kbExpr:nl.focus,primary:61,mac:{primary:2085,secondary:[61]}}})||this}return RD(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(ZD),KD=function(e){function t(){return e.call(this,{id:_w.PreviousMatchFindAction,label:ns("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:null,kbOpts:{kbExpr:nl.focus,primary:1085,mac:{primary:3109,secondary:[1085]}}})||this}return RD(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(ZD),qD=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return RD(t,e),t.prototype.run=function(e,t){var n=VD.get(t);if(n){var r=WD(t);r&&n.setSearchString(r),this._run(n)||(n.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0}),this._run(n))}},t}(qu),QD=function(e){function t(){return e.call(this,{id:_w.NextSelectionMatchFindAction,label:ns("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:null,kbOpts:{kbExpr:nl.focus,primary:2109}})||this}return RD(t,e),t.prototype._run=function(e){return e.moveToNextMatch()},t}(qD),XD=function(e){function t(){return e.call(this,{id:_w.PreviousSelectionMatchFindAction,label:ns("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:null,kbOpts:{kbExpr:nl.focus,primary:3133}})||this}return RD(t,e),t.prototype._run=function(e){return e.moveToPrevMatch()},t}(qD),JD=function(e){function t(){return e.call(this,{id:_w.StartFindReplaceAction,label:ns("startReplace","Replace"),alias:"Replace",precondition:null,kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596}}})||this}return RD(t,e),t.prototype.run=function(e,t){if(!t.getConfiguration().readOnly){var n=VD.get(t),r=t.getSelection(),i=!r.isEmpty()&&r.startLineNumber===r.endLineNumber&&t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,o=n.getState().searchString||i?2:1;n&&n.start({forceRevealReplace:!0,seedSearchStringFromSelection:i,seedSearchStringFromGlobalClipboard:t.getConfiguration().contribInfo.find.seedSearchStringFromSelection,shouldFocus:o,shouldAnimate:!0})}},t}(qu),$D=function(e){function t(){return e.call(this,{id:_w.ShowNextFindTermAction,label:ns("showNextFindTermAction","Show Next Find Term"),alias:"Show Next Find Term",precondition:hw,kbOpts:{weight:au.WEIGHT.editorContrib(5),kbExpr:mu.and(dw,nl.focus),primary:bw.primary,mac:bw.mac,win:bw.win,linux:bw.linux}})||this}return RD(t,e),t.prototype._run=function(e){return e.showNextFindTerm()},t}(ZD),eE=function(e){function t(){return e.call(this,{id:_w.ShowPreviousFindTermAction,label:ns("showPreviousFindTermAction","Show Previous Find Term"),alias:"Find Show Previous Find Term",precondition:hw,kbOpts:{weight:au.WEIGHT.editorContrib(5),kbExpr:mu.and(dw,nl.focus),primary:yw.primary,mac:yw.mac,win:yw.win,linux:yw.linux}})||this}return RD(t,e),t.prototype._run=function(e){return e.showPreviousFindTerm()},t}(ZD);el(HD),$u(UD),$u(YD),$u(GD),$u(KD),$u(QD),$u(XD),$u(JD),$u($D),$u(eE);var tE=Ku.bindToContribution(VD.get);Ju(new tE({id:_w.CloseFindWidgetCommand,precondition:hw,handler:function(e){return e.closeFindWidget()},kbOpts:{weight:au.WEIGHT.editorContrib(5),kbExpr:nl.focus,primary:9,secondary:[1033]}})),Ju(new tE({id:_w.ToggleCaseSensitiveCommand,precondition:null,handler:function(e){return e.toggleCaseSensitive()},kbOpts:{weight:au.WEIGHT.editorContrib(5),kbExpr:nl.focus,primary:fw.primary,mac:fw.mac,win:fw.win,linux:fw.linux}})),Ju(new tE({id:_w.ToggleWholeWordCommand,precondition:null,handler:function(e){return e.toggleWholeWords()},kbOpts:{weight:au.WEIGHT.editorContrib(5),kbExpr:nl.focus,primary:gw.primary,mac:gw.mac,win:gw.win,linux:gw.linux}})),Ju(new tE({id:_w.ToggleRegexCommand,precondition:null,handler:function(e){return e.toggleRegex()},kbOpts:{weight:au.WEIGHT.editorContrib(5),kbExpr:nl.focus,primary:mw.primary,mac:mw.mac,win:mw.win,linux:mw.linux}})),Ju(new tE({id:_w.ToggleSearchScopeCommand,precondition:null,handler:function(e){return e.toggleSearchScope()},kbOpts:{weight:au.WEIGHT.editorContrib(5),kbExpr:nl.focus,primary:vw.primary,mac:vw.mac,win:vw.win,linux:vw.linux}})),Ju(new tE({id:_w.ReplaceOneAction,precondition:hw,handler:function(e){return e.replace()},kbOpts:{weight:au.WEIGHT.editorContrib(5),kbExpr:nl.focus,primary:3094}})),Ju(new tE({id:_w.ReplaceAllAction,precondition:hw,handler:function(e){return e.replaceAll()},kbOpts:{weight:au.WEIGHT.editorContrib(5),kbExpr:nl.focus,primary:2563}})),Ju(new tE({id:_w.SelectAllMatchesAction,precondition:hw,handler:function(e){return e.selectAllMatches()},kbOpts:{weight:au.WEIGHT.editorContrib(5),kbExpr:nl.focus,primary:515}}));var nE=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rE=function(e){function t(n){var r=e.call(this)||this;return r.name=t.Name,r.message=n,r}return nE(t,e),t.Name="NOPRO",t}(Error);function iE(e,t,n){var r,i=wi.ordered(e);return 0===i.length?cn.b.wrapError(new rE):Wl(i.map(function(i){return function(){if(Zn(r))return Pl(function(r){return i.provideDocumentRangeFormattingEdits(e,t,n,r)}).then(function(e){r=e},fn)}})).then(function(){return r})}function oE(e,t){var n,r=Ci.ordered(e);return 0===r.length?iE(e,e.getFullModelRange(),t):Wl(r.map(function(r){return function(){if(Zn(n))return Pl(function(n){return r.provideDocumentFormattingEdits(e,t,n)}).then(function(e){n=e},fn)}})).then(function(){return n})}function sE(e,t,n,r){var i=Di.ordered(e)[0];return i?i.autoFormatTriggerCharacters.indexOf(n)<0?cn.b.as(void 0):Pl(function(o){return i.provideOnTypeFormattingEdits(e,t,n,r,o)}).then(function(e){return e},fn):cn.b.as(void 0)}Qu("_executeFormatRangeProvider",function(e,t){var n=t.resource,r=t.range,i=t.options;if(!(n instanceof Be&&be.isIRange(r)))throw yn();var o=e.get(Br).getModel(n);if(!o)throw yn("resource");return iE(o,be.lift(r),i)}),Qu("_executeFormatDocumentProvider",function(e,t){var n=t.resource,r=t.options;if(!(n instanceof Be))throw yn("resource");var i=e.get(Br).getModel(n);if(!i)throw yn("resource");return oE(i,r)}),Xu("_executeFormatOnTypeProvider",function(e,t,n){var r=n.ch,i=n.options;if("string"!=typeof r)throw yn("ch");return sE(e,t,r,i)});var aE=function(){function e(e,t){this._initialSelection=t,this._edits=e}return e._handleEolEdits=function(e,t){for(var n=void 0,r=[],i=0,o=t;i0){var s=r.modifyPosition(e.getStartPosition(),o);e=new be(s.lineNumber,s.column,e.endLineNumber,e.endColumn),t=t.substring(o),i=i.substr(o)}var a=Lt(t,i);if(a>0){var u=r.modifyPosition(e.getEndPosition(),-a);e=new be(e.startLineNumber,e.startColumn,u.lineNumber,u.column),t=t.substring(0,t.length-a),i=i.substring(0,i.length-a)}return{text:t,range:e,forceMoveMarkers:n}},e}(),uE=Or("editorWorkerService"),lE=function(){function e(e,t){if(this.flags=t,0!=(1&this.flags)){var n=e.getModel();this.modelVersionId=n?$e("{0}#{1}",n.uri.toString(),n.getVersionId()):null}0!=(4&this.flags)&&(this.position=e.getPosition()),0!=(2&this.flags)&&(this.selection=e.getSelection()),0!=(8&this.flags)&&(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop())}return e.prototype._equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.modelVersionId===n.modelVersionId&&(this.scrollLeft===n.scrollLeft&&this.scrollTop===n.scrollTop&&(!(!this.position&&n.position||this.position&&!n.position||this.position&&n.position&&!this.position.equals(n.position))&&!(!this.selection&&n.selection||this.selection&&!n.selection||this.selection&&n.selection&&!this.selection.equalsRange(n.selection))))},e.prototype.validate=function(t){return this._equals(new e(t,this.flags))},e}(),cE=function(){function e(e,t){this._visiblePosition=e,this._visiblePositionScrollDelta=t}return e.capture=function(t){var n=null,r=0;if(0!==t.getScrollTop()){var i=t.getVisibleRanges();if(i.length>0){n=i[0].getStartPosition();var o=t.getTopForPosition(n.lineNumber,n.column);r=t.getScrollTop()-o}}return new e(n,r)},e.prototype.restore=function(e){if(this._visiblePosition){var t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}},e}(),hE=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dE=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},pE=function(e,t){return function(n,r){t(n,r,e)}};function fE(e){if((e=e.filter(function(e){return e.range})).length){for(var t=e[0].range,n=1;n1)){var n=this.editor.getModel(),r=this.editor.getPosition(),i=!1,o=this.editor.onDidChangeModelContent(function(e){if(e.isFlush)return i=!0,void o.dispose();for(var t=0,n=e.changes.length;t1)){var n=this.editor.getModel(),r=n.getOptions(),i=r.tabSize,o=r.insertSpaces,s=new lE(this.editor,5);iE(n,e,{tabSize:i,insertSpaces:o}).then(function(e){return t.workerService.computeMoreMinimalEdits(n.uri,e)}).then(function(e){s.validate(t.editor)&&!Zn(e)&&(aE.execute(t.editor,e),fE(e))})}},e.prototype.getId=function(){return e.ID},e.prototype.dispose=function(){this.callOnDispose=on(this.callOnDispose),this.callOnModel=on(this.callOnModel)},e.ID="editor.contrib.formatOnPaste",e=dE([pE(1,uE)],e)}(),_E=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return hE(t,e),t.prototype.run=function(e,t){var n=this,r=e.get(uE),i=e.get(Yb),o=this._getFormattingEdits(t);if(!o)return cn.b.as(void 0);var s=new lE(t,5);return o.then(function(e){return r.computeMoreMinimalEdits(t.getModel().uri,e)}).then(function(e){s.validate(t)&&!Zn(e)&&(aE.execute(t,e),fE(e),t.focus())},function(e){if(!(e instanceof Error&&e.name===rE.Name))throw e;n._notifyNoProviderError(i,t.getModel().getLanguageIdentifier().language)})},t.prototype._notifyNoProviderError=function(e,t){e.info(ns("no.provider","There is no formatter for '{0}'-files installed.",t))},t}(qu),CE=function(e){function t(){return e.call(this,{id:"editor.action.formatDocument",label:ns("formatDocument.label","Format Document"),alias:"Format Document",precondition:nl.writable,kbOpts:{kbExpr:nl.editorTextFocus,primary:1572,linux:{primary:3111}},menuOpts:{when:nl.hasDocumentFormattingProvider,group:"1_modification",order:1.3}})||this}return hE(t,e),t.prototype._getFormattingEdits=function(e){var t=e.getModel(),n=t.getOptions();return oE(t,{tabSize:n.tabSize,insertSpaces:n.insertSpaces})},t.prototype._notifyNoProviderError=function(e,t){e.info(ns("no.documentprovider","There is no document formatter for '{0}'-files installed.",t))},t}(_E),wE=function(e){function t(){return e.call(this,{id:"editor.action.formatSelection",label:ns("formatSelection.label","Format Selection"),alias:"Format Code",precondition:mu.and(nl.writable,nl.hasNonEmptySelection),kbOpts:{kbExpr:nl.editorTextFocus,primary:Ja(2089,2084)},menuOpts:{when:mu.and(nl.hasDocumentSelectionFormattingProvider,nl.hasNonEmptySelection),group:"1_modification",order:1.31}})||this}return hE(t,e),t.prototype._getFormattingEdits=function(e){var t=e.getModel(),n=t.getOptions(),r=n.tabSize,i=n.insertSpaces;return iE(t,e.getSelection(),{tabSize:r,insertSpaces:i})},t.prototype._notifyNoProviderError=function(e,t){e.info(ns("no.selectionprovider","There is no selection formatter for '{0}'-files installed.",t))},t}(_E);el(yE),el(bE),$u(CE),$u(wE),Ga.registerCommand("editor.action.format",function(e){var t=e.get(Wu).getFocusedCodeEditor();if(t)return(new(function(e){function t(){return e.call(this,{})||this}return hE(t,e),t.prototype._getFormattingEdits=function(e){var t=e.getModel(),n=e.getSelection(),r=t.getOptions(),i=r.tabSize,o=r.insertSpaces;return n.isEmpty()?oE(t,{tabSize:i,insertSpaces:o}):iE(t,n,{tabSize:i,insertSpaces:o})},t}(_E))).run(e,t)}),(mE=gE||(gE={}))[mE.Hint=1]="Hint",mE[mE.Info=2]="Info",mE[mE.Warning=4]="Warning",mE[mE.Error=8]="Error",function(e){e.compare=function(e,t){return t-e};var t=Object.create(null);t[e.Error]=ns("sev.error","Error"),t[e.Warning]=ns("sev.warning","Warning"),t[e.Info]=ns("sev.info","Info"),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case Ub.Error:return e.Error;case Ub.Warning:return e.Warning;case Ub.Info:return e.Info;case Ub.Ignore:return e.Hint}}}(gE||(gE={})),function(e){var t="";e.makeKey=function(e){var n=[t];return e.source?n.push(e.source.replace("¦","¦")):n.push(t),e.code?n.push(e.code.replace("¦","¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(gE.toString(e.severity)):n.push(t),e.message?n.push(e.message.replace("¦","¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}}(vE||(vE={}));var DE=Or("markerService"),EE=(n(346),n(347),new md(new pd(0,122,204))),AE={showArrow:!0,showFrame:!0,className:"",frameColor:EE,arrowColor:EE,keepEditorSelection:!1},SE=function(){function e(e,t,n,r,i,o){this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=r,this._onDomNodeTop=i,this._onComputedHeight=o}return e.prototype.onDomNodeTop=function(e){this._onDomNodeTop(e)},e.prototype.onComputedHeight=function(e){this._onComputedHeight(e)},e}(),xE=function(){function e(e,t){this._id=e,this._domNode=t}return e.prototype.getId=function(){return this._id},e.prototype.getDomNode=function(){return this._domNode},e.prototype.getPosition=function(){return null},e}(),ME=function(){function e(t){this._editor=t,this._ruleName=e._IdGenerator.nextId(),this._decorations=[]}return e.prototype.dispose=function(){this.hide(),hh(this._ruleName)},Object.defineProperty(e.prototype,"color",{set:function(e){this._color!==e&&(this._color=e,this._updateStyle())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{set:function(e){this._height!==e&&(this._height=e,this._updateStyle())},enumerable:!0,configurable:!0}),e.prototype._updateStyle=function(){var e,t,n;hh(this._ruleName),e=".monaco-editor "+this._ruleName,t="border-style: solid; border-color: transparent; border-bottom-color: "+this._color+"; border-width: "+this._height+"px; bottom: -"+this._height+"px; margin-left: -"+this._height+"px; ",void 0===n&&(n=ch()),n&&t&&n.sheet.insertRule(e+"{"+t+"}",0)},e.prototype.show=function(e){this._decorations=this._editor.deltaDecorations(this._decorations,[{range:be.fromPositions(e),options:{className:this._ruleName,stickiness:Pn.NeverGrowsWhenTypingAtEdges}}])},e.prototype.hide=function(){this._editor.deltaDecorations(this._decorations,[])},e._IdGenerator=new Sw(".arrow-decoration-"),e}(),NE=function(){function e(e,t){void 0===t&&(t={});var n=this;this._positionMarkerId=[],this._disposables=[],this._isShowing=!1,this.editor=e,this.options=cs(t),ds(this.options,AE,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.push(this.editor.onDidLayoutChange(function(e){var t=n._getWidth(e);n.domNode.style.width=t+"px",n.domNode.style.left=n._getLeft(e)+"px",n._onWidth(t)}))}return e.prototype.dispose=function(){var e=this;on(this._disposables),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(function(t){t.removeZone(e._viewZone.id),e._viewZone=null}),this.editor.deltaDecorations(this._positionMarkerId,[]),this._positionMarkerId=[]},e.prototype.create=function(){Mc(this.domNode,"zone-widget"),Mc(this.domNode,this.options.className),this.container=document.createElement("div"),Mc(this.container,"zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new ME(this.editor),this._disposables.push(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()},e.prototype.style=function(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()},e.prototype._applyStyles=function(){if(this.container){var e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow){var t=this.options.arrowColor.toString();this._arrow.color=t}},e.prototype._getWidth=function(e){return e.width-e.minimapWidth-e.verticalScrollbarWidth},e.prototype._getLeft=function(e){return e.minimapWidth>0&&0===e.minimapLeft?e.minimapWidth:0},e.prototype._onViewZoneTop=function(e){this.domNode.style.top=e+"px"},e.prototype._onViewZoneHeight=function(e){this.domNode.style.height=e+"px";var t=e-this._decoratingElementsHeight();this.container.style.height=t+"px";var n=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(n)),this._resizeSash.layout()},Object.defineProperty(e.prototype,"position",{get:function(){var e=this._positionMarkerId[0];if(e){var t=this.editor.getModel().getDecorationRange(e);if(t)return t.getStartPosition()}},enumerable:!0,configurable:!0}),e.prototype.show=function(e,t){var n=be.isIRange(e)?e:new be(e.lineNumber,e.column,e.lineNumber,e.column);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId=this.editor.deltaDecorations(this._positionMarkerId,[{range:n,options:Ma.EMPTY}])},e.prototype.hide=function(){var e=this;this._viewZone&&(this.editor.changeViewZones(function(t){t.removeZone(e._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow&&this._arrow.hide()},e.prototype._decoratingElementsHeight=function(){var e=this.editor.getConfiguration().lineHeight,t=0;this.options.showArrow&&(t+=2*Math.round(e/3));this.options.showFrame&&(t+=2*Math.round(e/9));return t},e.prototype._showImpl=function(e,t){var n=this,r={lineNumber:e.startLineNumber,column:e.startColumn},i=this.editor.getLayoutInfo(),o=this._getWidth(i);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(i)+"px";var s=document.createElement("div");s.style.overflow="hidden";var a=this.editor.getConfiguration().lineHeight,u=this.editor.getLayoutInfo().height/a*.8;t>=u&&(t=u);var l=0,c=0;if(this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(r)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(function(e){n._viewZone&&e.removeZone(n._viewZone.id),n._overlayWidget&&(n.editor.removeOverlayWidget(n._overlayWidget),n._overlayWidget=null),n.domNode.style.top="-1000px",n._viewZone=new SE(s,r.lineNumber,r.column,t,function(e){return n._onViewZoneTop(e)},function(e){return n._onViewZoneHeight(e)}),n._viewZone.id=e.addZone(n._viewZone),n._overlayWidget=new xE("vs.editor.contrib.zoneWidget"+n._viewZone.id,n.domNode),n.editor.addOverlayWidget(n._overlayWidget)}),this.options.showFrame){var h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}var d=t*a-this._decoratingElementsHeight();this.container.style.top=l+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden",this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);var p=Math.min(this.editor.getModel().getLineCount(),Math.max(1,e.endLineNumber+1));this.revealLine(p)},e.prototype.revealLine=function(e){this.editor.revealLine(e,0)},e.prototype.setCssClass=function(e,t){t&&this.container.classList.remove(t),Mc(this.container,e)},e.prototype._onWidth=function(e){},e.prototype._doLayout=function(e,t){},e.prototype._relayout=function(e){var t=this;this._viewZone.heightInLines!==e&&this.editor.changeViewZones(function(n){t._viewZone.heightInLines=e,n.layoutZone(t._viewZone.id)})},e.prototype._initSash=function(){var e,t=this;this._resizeSash=new pD(this.domNode,this,{orientation:Qw.HORIZONTAL}),this.options.isResizeable||(this._resizeSash.hide(),this._resizeSash.disable()),this._disposables.push(this._resizeSash.onDidStart(function(n){t._viewZone&&(e={startY:n.startY,heightInLines:t._viewZone.heightInLines})})),this._disposables.push(this._resizeSash.onDidEnd(function(){e=void 0})),this._disposables.push(this._resizeSash.onDidChange(function(n){if(e){var r=(n.currentY-e.startY)/t.editor.getConfiguration().lineHeight,i=r<0?Math.ceil(r):Math.floor(r),o=e.heightInLines+i;o>5&&o<35&&t._relayout(o)}}))},e.prototype.getHorizontalSashLeft=function(){return 0},e.prototype.getHorizontalSashTop=function(){return parseInt(this.domNode.style.height)-this._decoratingElementsHeight()/2},e.prototype.getHorizontalSashWidth=function(){var e=this.editor.getLayoutInfo();return e.width-e.minimapWidth},e}();function IE(e,t,n){if(!e)return null;if("string"==typeof e&&(e=Be.file(e)),e.scheme!==Md.file&&e.scheme!==Md.untitled)return e.with({query:null,fragment:null}).toString(!0);var r=t?t.getWorkspaceFolder(e):null;if(r){var i=t.getWorkspace().folders.length>1,o=void 0;if(o=(we.c?r.uri.fsPath===e.fsPath:xt(r.uri.fsPath,e.fsPath))?"":ir(rt(e.fsPath.substr(r.uri.fsPath.length),Jn),!0),i){var s=er(r.uri.fsPath);o=o?sr(s,o):s}return o}if(kE(e.fsPath))return ir(TE(e.fsPath),!0);var a=ir(e.fsPath,!0);return!we.g&&n&&(a=OE(a,n.userHome)),a}function LE(e){if(!e)return null;"string"==typeof e&&(e=Be.file(e));var t=er(e.fsPath)||e.fsPath;return kE(t)?TE(t):t}function kE(e){return we.g&&e&&":"===e[1]}function TE(e){return kE(e)?e.charAt(0).toUpperCase()+e.slice(1):e}var FE=Object.create(null);function OE(e,t){if(we.g||!e||!t)return e;var n=FE.original===t?FE.normalized:void 0;return n||(n=""+it(t,Xn)+Xn,FE={original:t,normalized:n}),(we.c?at(e,n):Nt(e,n))&&(e="~/"+e.substr(n.length)),e}var PE;!function(e){e[e.TEXT=0]="TEXT",e[e.VARIABLE=1]="VARIABLE",e[e.SEPARATOR=2]="SEPARATOR"}(PE||(PE={}));var BE=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),RE=function(){function e(e,t,n){var r=this;this.lines=0,this.longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=[],this._editor=t;var i=document.createElement("div");i.className="descriptioncontainer",i.setAttribute("aria-live","assertive"),i.setAttribute("role","alert"),this._messageBlock=document.createElement("span"),i.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),i.appendChild(this._relatedBlock),this._disposables.push(Tc(this._relatedBlock,"click",function(e){e.preventDefault();var t=r._relatedDiagnostics.get(e.target);t&&n(t)})),this._scrollable=new vb(i,{horizontal:rs.Auto,vertical:rs.Hidden,useShadows:!1,horizontalScrollbarSize:3}),Mc(this._scrollable.getDomNode(),"block"),e.appendChild(this._scrollable.getDomNode()),this._disposables.push(this._scrollable.onScroll(function(e){return i.style.left="-"+e.scrollLeft+"px"})),this._disposables.push(this._scrollable)}return e.prototype.dispose=function(){on(this._disposables)},e.prototype.update=function(e){var t=e.source,n=e.message,r=e.relatedInformation;if(t){this.lines=0,this.longestLineLength=0;for(var i=new Array(t.length+3+1).join(" "),o=n.split(/\r\n|\r|\n/g),s=0;s=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},qE=function(e,t){return function(n,r){t(n,r,e)}},QE=function(){function e(e,t){var n=this;this._editor=e,this._markers=null,this._nextIdx=-1,this._toUnbind=[],this._ignoreSelectionChange=!1,this._onCurrentMarkerChanged=new wn,this._onMarkerSetChanged=new wn,this.setMarkers(t),this._toUnbind.push(this._editor.onDidDispose(function(){return n.dispose()})),this._toUnbind.push(this._editor.onDidChangeCursorPosition(function(){n._ignoreSelectionChange||n.currentMarker&&be.containsPosition(n.currentMarker,n._editor.getPosition())||(n._nextIdx=-1)}))}return Object.defineProperty(e.prototype,"onCurrentMarkerChanged",{get:function(){return this._onCurrentMarkerChanged.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onMarkerSetChanged",{get:function(){return this._onMarkerSetChanged.event},enumerable:!0,configurable:!0}),e.prototype.setMarkers=function(e){var t=this._nextIdx>=0?this._markers[this._nextIdx]:void 0;this._markers=e||[],this._markers.sort(JE.compareMarker),this._nextIdx=t?Math.max(-1,Vn(this._markers,t,JE.compareMarker)):-1,this._onMarkerSetChanged.fire(this)},e.prototype.withoutWatchingEditorPosition=function(e){this._ignoreSelectionChange=!0;try{e()}finally{this._ignoreSelectionChange=!1}},e.prototype._initIdx=function(e){for(var t=!1,n=this._editor.getPosition(),r=0;r0?this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length:r=!0),n!==this._nextIdx){var i=this._markers[this._nextIdx];this._onCurrentMarkerChanged.fire(i)}return r},e.prototype.canNavigate=function(){return this._markers.length>0},e.prototype.findMarkerAtPosition=function(e){for(var t=0,n=this._markers;t0;t&&r&&(n[i]=e)}},function(e){fn(e)})});return cn.b.join(r).then(function(){return Yn(n)})}Xu("_executeHoverProvider",oA);var sA=function(){function e(e,t,n,r){var i=this;this._computer=e,this._state=0,this._firstWaitScheduler=new Yl(function(){return i._triggerAsyncComputation()},this._getHoverTimeMillis()/2),this._secondWaitScheduler=new Yl(function(){return i._triggerSyncComputation()},this._getHoverTimeMillis()/2),this._loadingMessageScheduler=new Yl(function(){return i._showLoadingMessage()},3*this._getHoverTimeMillis()),this._asyncComputationPromise=null,this._asyncComputationPromiseDone=!1,this._completeCallback=t,this._errorCallback=n,this._progressCallback=r}return e.prototype._getHoverTimeMillis=function(){return this._computer.getHoverTimeMillis?this._computer.getHoverTimeMillis():e.HOVER_TIME},e.prototype._triggerAsyncComputation=function(){var e=this;this._state=2,this._secondWaitScheduler.schedule(),this._computer.computeAsync?(this._asyncComputationPromiseDone=!1,this._asyncComputationPromise=this._computer.computeAsync().then(function(t){e._asyncComputationPromiseDone=!0,e._withAsyncResult(t)},function(t){return e._onError(t)})):this._asyncComputationPromiseDone=!0},e.prototype._triggerSyncComputation=function(){this._computer.computeSync&&this._computer.onResult(this._computer.computeSync(),!0),this._asyncComputationPromiseDone?(this._state=0,this._onComplete(this._computer.getResult())):(this._state=3,this._onProgress(this._computer.getResult()))},e.prototype._showLoadingMessage=function(){3===this._state&&this._onProgress(this._computer.getResultWithLoadingMessage())},e.prototype._withAsyncResult=function(e){e&&this._computer.onResult(e,!1),3===this._state&&(this._state=0,this._onComplete(this._computer.getResult()))},e.prototype._onComplete=function(e){this._completeCallback&&this._completeCallback(e)},e.prototype._onError=function(e){this._errorCallback?this._errorCallback(e):pn(e)},e.prototype._onProgress=function(e){this._progressCallback&&this._progressCallback(e)},e.prototype.start=function(){0===this._state&&(this._state=1,this._firstWaitScheduler.schedule(),this._loadingMessageScheduler.schedule())},e.prototype.cancel=function(){this._loadingMessageScheduler.cancel(),1===this._state&&this._firstWaitScheduler.cancel(),2===this._state&&(this._secondWaitScheduler.cancel(),this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null)),3===this._state&&this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null),this._state=0},e.HOVER_TIME=300,e}(),aA=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),uA=function(e){function t(t,n){var r=e.call(this)||this;return r.disposables=[],r.allowEditorOverflow=!0,r._id=t,r._editor=n,r._isVisible=!1,r._containerDomNode=document.createElement("div"),r._containerDomNode.className="monaco-editor-hover hidden",r._containerDomNode.tabIndex=0,r._domNode=document.createElement("div"),r._domNode.className="monaco-editor-hover-content",r.scrollbar=new bb(r._domNode,{}),r.disposables.push(r.scrollbar),r._containerDomNode.appendChild(r.scrollbar.getDomNode()),r.onkeydown(r._containerDomNode,function(e){e.equals(9)&&r.hide()}),r._register(r._editor.onDidChangeConfiguration(function(e){e.fontInfo&&r.updateFont()})),r._editor.onDidLayoutChange(function(e){return r.updateMaxHeight()}),r.updateMaxHeight(),r._editor.addContentWidget(r),r._showAtPosition=null,r}return aA(t,e),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){this._isVisible=e,Ic(this._containerDomNode,"hidden",!this._isVisible)},enumerable:!0,configurable:!0}),t.prototype.getId=function(){return this._id},t.prototype.getDomNode=function(){return this._containerDomNode},t.prototype.showAt=function(e,t){this._showAtPosition=new ye(e.lineNumber,e.column),this.isVisible=!0,this._editor.layoutContentWidget(this),this._editor.render(),this._stoleFocus=t,t&&this._containerDomNode.focus()},t.prototype.hide=function(){this.isVisible&&(this.isVisible=!1,this._editor.layoutContentWidget(this),this._stoleFocus&&this._editor.focus())},t.prototype.getPosition=function(){return this.isVisible?{position:this._showAtPosition,preference:[Bu.ABOVE,Bu.BELOW]}:null},t.prototype.dispose=function(){this._editor.removeContentWidget(this),this.disposables=on(this.disposables),e.prototype.dispose.call(this)},t.prototype.updateFont=function(){var e=this;Array.prototype.slice.call(this._domNode.getElementsByClassName("code")).forEach(function(t){return e._editor.applyFontInfo(t)})},t.prototype.updateContents=function(e){this._domNode.textContent="",this._domNode.appendChild(e),this.updateFont(),this._editor.layoutContentWidget(this),this.onContentsChange()},t.prototype.onContentsChange=function(){this.scrollbar.scanDomNode()},t.prototype.updateMaxHeight=function(){var e=Math.max(this._editor.getLayoutInfo().height/4,250),t=this._editor.getConfiguration().fontInfo,n=t.fontSize,r=t.lineHeight;this._domNode.style.fontSize=n+"px",this._domNode.style.lineHeight=r+"px",this._domNode.style.maxHeight=e+"px"},t}(eb),lA=function(e){function t(t,n){var r=e.call(this)||this;return r._id=t,r._editor=n,r._isVisible=!1,r._domNode=document.createElement("div"),r._domNode.className="monaco-editor-hover hidden",r._domNode.setAttribute("aria-hidden","true"),r._domNode.setAttribute("role","presentation"),r._showAtLineNumber=-1,r._register(r._editor.onDidChangeConfiguration(function(e){e.fontInfo&&r.updateFont()})),r._editor.addOverlayWidget(r),r}return aA(t,e),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._isVisible},set:function(e){this._isVisible=e,Ic(this._domNode,"hidden",!this._isVisible)},enumerable:!0,configurable:!0}),t.prototype.getId=function(){return this._id},t.prototype.getDomNode=function(){return this._domNode},t.prototype.showAt=function(e){this._showAtLineNumber=e,this.isVisible||(this.isVisible=!0);var t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(this._showAtLineNumber),r=this._editor.getScrollTop(),i=this._editor.getConfiguration().lineHeight,o=n-r-(this._domNode.clientHeight-i)/2;this._domNode.style.left=t.glyphMarginLeft+t.glyphMarginWidth+"px",this._domNode.style.top=Math.max(Math.round(o),0)+"px"},t.prototype.hide=function(){this.isVisible&&(this.isVisible=!1)},t.prototype.getPosition=function(){return null},t.prototype.dispose=function(){this._editor.removeOverlayWidget(this),e.prototype.dispose.call(this)},t.prototype.updateFont=function(){var e=this,t=Array.prototype.slice.call(this._domNode.getElementsByTagName("code")),n=Array.prototype.slice.call(this._domNode.getElementsByClassName("code"));t.concat(n).forEach(function(t){return e._editor.applyFontInfo(t)})},t.prototype.updateContents=function(e){this._domNode.textContent="",this._domNode.appendChild(e),this.updateFont()},t}(eb),cA=function(){function e(e,t,n){this.presentationIndex=n,this._onColorFlushed=new wn,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new wn,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new wn,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}return Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"presentation",{get:function(){return this.colorPresentations[this.presentationIndex]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorPresentations",{get:function(){return this._colorPresentations},set:function(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)},enumerable:!0,configurable:!0}),e.prototype.selectNextColorPresentation=function(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)},e.prototype.guessColorPresentation=function(e,t){for(var n=0;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},NA=function(e,t){return function(n,r){t(n,r,e)}},IA=function(){function e(e,t,n){var r=this;this._editor=e,this._codeEditorService=t,this._configurationService=n,this._globalToDispose=[],this._localToDispose=[],this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=[],this._decorationsTypes={},this._globalToDispose.push(e.onDidChangeModel(function(e){r._isEnabled=r.isEnabled(),r.onModelChanged()})),this._globalToDispose.push(e.onDidChangeModelLanguage(function(e){return r.onModelChanged()})),this._globalToDispose.push(Ai.onDidChange(function(e){return r.onModelChanged()})),this._globalToDispose.push(e.onDidChangeConfiguration(function(e){var t=r._isEnabled;r._isEnabled=r.isEnabled(),t!==r._isEnabled&&(r._isEnabled?r.onModelChanged():r.removeAllDecorations())})),this._timeoutPromise=null,this._computePromise=null,this._isEnabled=this.isEnabled(),this.onModelChanged()}return e.prototype.isEnabled=function(){var e=this._editor.getModel();if(!e)return!1;var t=e.getLanguageIdentifier(),n=this._configurationService.getValue(t.language);if(n){var r=n.colorDecorators;if(r&&void 0!==r.enable&&!r.enable)return r.enable}return this._editor.getConfiguration().contribInfo.colorDecorators},e.prototype.getId=function(){return e.ID},e.get=function(e){return e.getContribution(this.ID)},e.prototype.dispose=function(){this.stop(),this.removeAllDecorations(),this._globalToDispose=on(this._globalToDispose)},e.prototype.onModelChanged=function(){var t=this;if(this.stop(),this._isEnabled){var n=this._editor.getModel();Ai.has(n)&&(this._localToDispose.push(this._editor.onDidChangeModelContent(function(n){t._timeoutPromise||(t._timeoutPromise=cn.b.timeout(e.RECOMPUTE_TIME),t._timeoutPromise.then(function(){t._timeoutPromise=null,t.beginCompute()}))})),this.beginCompute())}},e.prototype.beginCompute=function(){var e,t,n,r=this;this._computePromise=(e=this._editor.getModel(),t=[],n=Ai.ordered(e).reverse().map(function(n){return Pl(function(t){return n.provideDocumentColors(e,t)}).then(function(e){if(Array.isArray(e))for(var r=0,i=e;rthis._editor.getModel().getLineCount())return[];var n=IA.get(this._editor),r=this._editor.getModel().getLineMaxColumn(t),i=!1;return this._editor.getLineDecorations(t).map(function(o){var s=o.range.startLineNumber===t?o.range.startColumn:1,a=o.range.endLineNumber===t?o.range.endColumn:r;if(s>e._range.startColumn||e._range.endColumn>a)return null;var u=new be(e._range.startLineNumber,s,e._range.startLineNumber,a),l=n.getColorData(o.range.getStartPosition());if(!i&&l){i=!0;var c=l.colorInfo,h=c.color,d=c.range;return new TA(d,h,l.provider)}if(Nw(o.options.hoverMessage))return null;var p=void 0;return o.options.hoverMessage&&(p=Array.isArray(o.options.hoverMessage)?o.options.hoverMessage.slice():[o.options.hoverMessage]),{contents:p,range:u}}).filter(function(e){return!!e})},e.prototype.onResult=function(e,t){this._result=t?e.concat(this._result.sort(function(e,t){return e instanceof TA?-1:t instanceof TA?1:0})):this._result.concat(e)},e.prototype.getResult=function(){return this._result.slice(0)},e.prototype.getResultWithLoadingMessage=function(){return this._result.slice(0).concat([this._getLoadingMessage()])},e.prototype._getLoadingMessage=function(){return{range:this._range,contents:[(new Mw).appendText(ns("modesContentHover.loading","Loading..."))]}},e}(),OA=function(e){function t(n,r,i){var o=e.call(this,t.ID,n)||this;return o._themeService=i,o.renderDisposable=rn,o.toDispose=[],o._computer=new FA(o._editor),o._highlightDecorations=[],o._isChangingDecorations=!1,o._markdownRenderer=r,r.onDidRenderCodeBlock(o.onContentsChange,o,o.toDispose),o._hoverOperation=new sA(o._computer,function(e){return o._withResult(e,!0)},null,function(e){return o._withResult(e,!1)}),o.toDispose.push(Tc(o.getDomNode(),ph.FOCUS,function(){o._colorPicker&&Mc(o.getDomNode(),"colorpicker-hover")})),o.toDispose.push(Tc(o.getDomNode(),ph.BLUR,function(){Nc(o.getDomNode(),"colorpicker-hover")})),o}return LA(t,e),t.prototype.dispose=function(){this.renderDisposable.dispose(),this.renderDisposable=rn,this._hoverOperation.cancel(),this.toDispose=on(this.toDispose),e.prototype.dispose.call(this)},t.prototype.onModelDecorationsChanged=function(){this._isChangingDecorations||this.isVisible&&(this._hoverOperation.cancel(),this._computer.clearResult(),this._colorPicker||this._hoverOperation.start())},t.prototype.startShowingAt=function(e,t){if(!this._lastRange||!this._lastRange.equalsRange(e)){if(this._hoverOperation.cancel(),this.isVisible)if(this._showAtPosition.lineNumber!==e.startLineNumber)this.hide();else{for(var n=[],r=0,i=this._messages.length;r=e.endColumn&&n.push(o)}if(n.length>0){if(function(e,t){if(!e&&t||e&&!t||e.length!==t.length)return!1;for(var n=0;n0?this._renderMessages(this._lastRange,this._messages):t&&this.hide()},t.prototype._renderMessages=function(e,n){var r=this;this.renderDisposable.dispose(),this._colorPicker=null;var i,o=Number.MAX_VALUE,s=n[0].range,a=document.createDocumentFragment(),u=!0,l=!1;n.forEach(function(t){if(t.range)if(o=Math.min(o,t.range.startColumn),s=be.plusRange(s,t.range),t instanceof TA){l=!0;var n=t.color,c=n.red,h=n.green,d=n.blue,p=n.alpha,f=new pd(255*c,255*h,255*d,p),g=new md(f),m=r._editor.getModel(),v=new be(t.range.startLineNumber,t.range.startColumn,t.range.endLineNumber,t.range.endColumn),y={range:t.range,color:t.color},b=new cA(g,[],0),_=new bA(a,b,r._editor.getConfiguration().pixelRatio,r._themeService);_A(m,y,t.provider).then(function(n){b.colorPresentations=n;var s=r._editor.getModel().getValueInRange(t.range);b.guessColorPresentation(g,s);var u=function(){var e,t;b.presentation.textEdit?(e=[b.presentation.textEdit],t=(t=new be(b.presentation.textEdit.range.startLineNumber,b.presentation.textEdit.range.startColumn,b.presentation.textEdit.range.endLineNumber,b.presentation.textEdit.range.endColumn)).setEndPosition(t.endLineNumber,t.startColumn+b.presentation.textEdit.text.length)):(e=[{identifier:null,range:v,text:b.presentation.label,forceMoveMarkers:!1}],t=v.setEndPosition(v.endLineNumber,v.startColumn+b.presentation.label.length)),m.pushEditOperations([],e,function(){return[]}),b.presentation.additionalTextEdits&&(e=b.presentation.additionalTextEdits.slice(),m.pushEditOperations([],e,function(){return[]}),r.hide()),r._editor.pushUndoStop(),v=t},l=function(e){return _A(m,{range:v,color:{red:e.rgba.r/255,green:e.rgba.g/255,blue:e.rgba.b/255,alpha:e.rgba.a}},t.provider).then(function(e){b.colorPresentations=e})},c=b.onColorFlushed(function(e){l(e).then(u)}),h=b.onDidChangeColor(l);r._colorPicker=_,r.showAt(new ye(e.startLineNumber,o),r._shouldFocus),r.updateContents(a),r._colorPicker.layout(),r.renderDisposable=sn([c,h,_,i])})}else t.contents.filter(function(e){return!Nw(e)}).forEach(function(e){var t=r._markdownRenderer.render(e);i=t,a.appendChild(kA("div.hover-row",null,t.element)),u=!1})}),l||u||(this.showAt(new ye(e.startLineNumber,o),this._shouldFocus),this.updateContents(a)),this._isChangingDecorations=!0,this._highlightDecorations=this._editor.deltaDecorations(this._highlightDecorations,[{range:s,options:t._DECORATION_OPTIONS}]),this._isChangingDecorations=!1},t.ID="editor.contrib.modesContentHoverWidget",t._DECORATION_OPTIONS=Ma.register({className:"hoverHighlight"}),t}(uA);var PA=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),BA=function(){function e(e){this._editor=e,this._lineNumber=-1}return e.prototype.setLineNumber=function(e){this._lineNumber=e,this._result=[]},e.prototype.clearResult=function(){this._result=[]},e.prototype.computeSync=function(){for(var e=function(e){return{value:e}},t=this._editor.getLineDecorations(this._lineNumber),n=[],r=0,i=t.length;r0?this._renderMessages(this._lastLineNumber,this._messages):this.hide()},t.prototype._renderMessages=function(e,t){var n=this;on(this._renderDisposeables),this._renderDisposeables=[];var r=document.createDocumentFragment();t.forEach(function(e){var t=n._markdownRenderer.render(e.value);n._renderDisposeables.push(t),r.appendChild(bh("div.hover-row",null,t.element))}),this.updateContents(r),this.showAt(e)},t.ID="editor.contrib.modesGlyphHoverWidget",t}(lA),jA=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},zA=function(e,t){return function(n,r){t(n,r,e)}},WA=function(){function e(e,t,n){void 0===n&&(n=rA),this._editor=e,this._modeService=t,this._openerService=n,this._onDidRenderCodeBlock=new wn,this.onDidRenderCodeBlock=this._onDidRenderCodeBlock.event}return e.prototype.getOptions=function(e){var t=this;return{codeBlockRenderer:function(e,n){var r=e?t._modeService.getModeIdForLanguageName(e):t._editor.getModel().getLanguageIdentifier().language;return t._modeService.getOrCreateMode(r).then(function(e){return ed(n,r)}).then(function(e){return''+e+""})},codeBlockRenderCallback:function(){return t._onDidRenderCodeBlock.fire()},actionHandler:{callback:function(e){t._openerService.open(Be.parse(e)).then(void 0,pn)},disposeables:e}}},e.prototype.render=function(e){var t=[];return{element:e?Pw(e,this.getOptions(t)):document.createElement("span"),dispose:function(){return on(t)}}},e=jA([zA(1,iA),zA(2,Pr(nA))],e)}(),VA=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),HA=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},UA=function(e,t){return function(n,r){t(n,r,e)}},YA=function(){function e(e,t,n,r){var i=this;this._openerService=t,this._modeService=n,this._themeService=r,this._editor=e,this._toUnhook=[],this._isMouseDown=!1,e.getConfiguration().contribInfo.hover&&(this._toUnhook.push(this._editor.onMouseDown(function(e){return i._onEditorMouseDown(e)})),this._toUnhook.push(this._editor.onMouseUp(function(e){return i._onEditorMouseUp(e)})),this._toUnhook.push(this._editor.onMouseMove(function(e){return i._onEditorMouseMove(e)})),this._toUnhook.push(this._editor.onMouseLeave(function(e){return i._hideWidgets()})),this._toUnhook.push(this._editor.onKeyDown(function(e){return i._onKeyDown(e)})),this._toUnhook.push(this._editor.onDidChangeModel(function(){return i._hideWidgets()})),this._toUnhook.push(this._editor.onDidChangeModelDecorations(function(){return i._onModelDecorationsChanged()})),this._toUnhook.push(this._editor.onDidScrollChange(function(e){(e.scrollTopChanged||e.scrollLeftChanged)&&i._hideWidgets()})))}return Object.defineProperty(e.prototype,"contentWidget",{get:function(){return this._contentWidget||this._createHoverWidget(),this._contentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"glyphWidget",{get:function(){return this._glyphWidget||this._createHoverWidget(),this._glyphWidget},enumerable:!0,configurable:!0}),e.get=function(t){return t.getContribution(e.ID)},e.prototype._onModelDecorationsChanged=function(){this.contentWidget.onModelDecorationsChanged(),this.glyphWidget.onModelDecorationsChanged()},e.prototype._onEditorMouseDown=function(e){this._isMouseDown=!0;var t=e.target.type;t!==ju.CONTENT_WIDGET||e.target.detail!==OA.ID?t===ju.OVERLAY_WIDGET&&e.target.detail===RA.ID||(t!==ju.OVERLAY_WIDGET&&e.target.detail!==RA.ID&&(this._hoverClicked=!1),this._hideWidgets()):this._hoverClicked=!0},e.prototype._onEditorMouseUp=function(e){this._isMouseDown=!1},e.prototype._onEditorMouseMove=function(e){var t=e.target.type,n=we.d?"metaKey":"ctrlKey";if(!(this._isMouseDown&&this._hoverClicked&&this.contentWidget.isColorPickerVisible())&&(t!==ju.CONTENT_WIDGET||e.target.detail!==OA.ID||e.event[n])&&(t!==ju.OVERLAY_WIDGET||e.target.detail!==RA.ID||e.event[n])){if(t===ju.CONTENT_EMPTY){var r=this._editor.getConfiguration().fontInfo.typicalHalfwidthCharacterWidth/2,i=e.target.detail;i&&!i.isAfterLines&&"number"==typeof i.horizontalDistanceToText&&i.horizontalDistanceToText=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},QA=function(e,t){return function(n,r){t(n,r,e)}},XA=function(){function e(e,t){this.editor=e,this.editorWorkerService=t,this.currentRequest=cn.b.as(null),this.decorationRemover=cn.b.as(null),this.decorationIds=[]}return e.get=function(t){return t.getContribution(e.ID)},e.prototype.dispose=function(){},e.prototype.getId=function(){return e.ID},e.prototype.run=function(t,n){var r=this;this.currentRequest.cancel();var i=this.editor.getSelection(),o=this.editor.getModel().uri;if(i.startLineNumber!==i.endLineNumber)return null;var s=new lE(this.editor,5);return this.editorWorkerService.canNavigateValueSet(o)?(this.currentRequest=this.editorWorkerService.navigateValueSet(o,i,n),this.currentRequest=this.currentRequest.then(function(e){return e&&e.range&&e.value?e:null})):this.currentRequest=cn.b.as(null),this.currentRequest.then(function(n){if(n&&n.range&&n.value&&s.validate(r.editor)){var o=be.lift(n.range),a=n.range,u=n.value.length-(i.endColumn-i.startColumn);a={startLineNumber:a.startLineNumber,startColumn:a.startColumn,endLineNumber:a.endLineNumber,endColumn:a.startColumn+n.value.length},u>1&&(i=new Ii(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn+u-1));var l=new GA(o,i,n.value);r.editor.pushUndoStop(),r.editor.executeCommand(t,l),r.editor.pushUndoStop(),r.decorationIds=r.editor.deltaDecorations(r.decorationIds,[{range:a,options:e.DECORATION}]),r.decorationRemover.cancel(),r.decorationRemover=cn.b.timeout(350),r.decorationRemover.then(function(){r.decorationIds=r.editor.deltaDecorations(r.decorationIds,[])})}})},e.ID="editor.contrib.inPlaceReplaceController",e.DECORATION=Ma.register({className:"valueSetReplacement"}),e=qA([QA(1,uE)],e)}(),JA=function(e){function t(){return e.call(this,{id:"editor.action.inPlaceReplace.up",label:ns("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:nl.writable,kbOpts:{kbExpr:nl.editorTextFocus,primary:3154}})||this}return KA(t,e),t.prototype.run=function(e,t){var n=XA.get(t);if(n)return n.run(this.id,!0)},t}(qu),$A=function(e){function t(){return e.call(this,{id:"editor.action.inPlaceReplace.down",label:ns("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:nl.writable,kbOpts:{kbExpr:nl.editorTextFocus,primary:3156}})||this}return KA(t,e),t.prototype.run=function(e,t){var n=XA.get(t);if(n)return n.run(this.id,!1)},t}(qu);el(XA),$u(JA),$u($A),Vg(function(e,t){var n=e.getColor(rm);n&&t.addRule(".monaco-editor.vs .valueSetReplacement { outline: solid 2px "+n+"; }")});var eS=function(){function e(e,t){this.selection=e,this.descending=t}return e.prototype.getEditOperations=function(e,t){var n=function(e,t,n){var r=tS(e,t,n);if(!r)return null;return S_.replace(new be(r.startLineNumber,1,r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),r.after.join("\n"))}(e,this.selection,this.descending);n&&t.addEditOperation(n.range,n.text),this.selectionId=t.trackSelection(this.selection)},e.prototype.computeCursorState=function(e,t){return t.getTrackedSelection(this.selectionId)},e.canRun=function(e,t,n){var r=tS(e,t,n);if(!r)return!1;for(var i=0,o=r.before.length;i=i)return null;for(var o=[],s=r;s<=i;s++)o.push(e.getLineContent(s));var a=o.slice(0);return a.sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}),!0===n&&(a=a.reverse()),{startLineNumber:r,endLineNumber:i,before:o,after:a}}var nS=function(){function e(e,t){this.selection=e,this.cursors=t}return e.prototype.getEditOperations=function(e,t){for(var n=function(e,t){t.sort(function(e,t){return e.lineNumber===t.lineNumber?e.column-t.column:e.lineNumber-t.lineNumber});for(var n=t.length-2;n>=0;n--)t[n].lineNumber===t[n+1].lineNumber&&t.splice(n,1);for(var r=[],i=0,o=0,s=t.length,a=1,u=e.getLineCount();a<=u;a++){var l=e.getLineContent(a),c=l.length+1,h=0;if(!(o1&&(n-=1,i=e.getLineMaxColumn(n)),t.addTrackedEditOperation(new be(n,i,r,o),null)}},e.prototype.computeCursorState=function(e,t){var n=t.getInverseEditOperations()[0].range;return new Ii(n.endLineNumber,this.restoreCursorToColumn,n.endLineNumber,this.restoreCursorToColumn)},e}();function oS(e,t){for(var n=0,r=0;r=r.startLineNumber+1&&t<=r.endLineNumber+1?e.getLineContent(t-1):e.getLineContent(t)};var v=Zo.getGoodIndentForLine(a,e.getLanguageIdAtPosition(c,1),r.startLineNumber+1,s);if(null!==v){m=_t(e.getLineContent(r.startLineNumber));if((C=oS(v,i))!==(w=oS(m,i))){var y=C-w;this.getIndentEditsOfMovingBlock(e,t,r,i,o,y)}}}}else t.addEditOperation(new be(r.startLineNumber,1,r.startLineNumber,1),d+"\n")}else{var b;if(c=r.startLineNumber-1,h=e.getLineContent(c),t.addEditOperation(new be(c,1,c+1,1),null),t.addEditOperation(new be(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),"\n"+h),this.shouldAutoIndent(e,r))if(a.getLineContent=function(t){return t===c?e.getLineContent(r.startLineNumber):e.getLineContent(t)},null!==(b=this.matchEnterRule(e,s,i,r.startLineNumber,r.startLineNumber-2)))0!==b&&this.getIndentEditsOfMovingBlock(e,t,r,i,o,b);else{var _=Zo.getGoodIndentForLine(a,e.getLanguageIdAtPosition(r.startLineNumber,1),c,s);if(null!==_){var C,w,D=_t(e.getLineContent(r.startLineNumber));if((C=oS(_,i))!==(w=oS(D,i))){y=C-w;this.getIndentEditsOfMovingBlock(e,t,r,i,o,y)}}}}}this._selectionId=t.trackSelection(r)}},e.prototype.buildIndentConverter=function(e){return{shiftIndent:function(t){for(var n=gl.shiftIndentCount(t,t.length+1,e),r="",i=0;i=1;){if(Ct(s===i&&void 0!==o?o:e.getLineContent(s))>=0)break;s--}if(s<1||r>e.getLineCount())return null;var a=e.getLineMaxColumn(s),u=Zo.getEnterAction(e,new be(s,a,s,a));if(u){var l=u.indentation,c=u.enterAction;c.indentAction===To.None?l=u.indentation+c.appendText:c.indentAction===To.Indent?l=u.indentation+c.appendText:c.indentAction===To.IndentOutdent?l=u.indentation:c.indentAction===To.Outdent&&(l=t.unshiftIndent(u.indentation)+c.appendText);var h=e.getLineContent(r);if(this.trimLeft(h).indexOf(this.trimLeft(l))>=0){var d=_t(e.getLineContent(r)),p=_t(l);return 2&Zo.getIndentMetadata(e,r)&&(p=t.unshiftIndent(p)),oS(p,n)-oS(d,n)}}return null},e.prototype.trimLeft=function(e){return e.replace(/^\s+/,"")},e.prototype.shouldAutoIndent=function(e,t){if(!this._autoIndent)return!1;if(!e.isCheapToTokenize(t.startLineNumber))return!1;var n=e.getLanguageIdAtPosition(t.startLineNumber,1);return n===e.getLanguageIdAtPosition(t.endLineNumber,1)&&null!==Zo.getIndentRulesSupport(n)},e.prototype.getIndentEditsOfMovingBlock=function(e,t,n,r,i,o){for(var s=n.startLineNumber;s<=n.endLineNumber;s++){var a=_t(e.getLineContent(s)),u=sS(oS(a,r)+o,r,i);u!==a&&(t.addEditOperation(new be(s,1,s,a.length+1),u),s===n.endLineNumber&&n.endColumn<=a.length+1&&""===u&&(this._moveEndLineSelectionShrink=!0))}},e.prototype.computeCursorState=function(e,t){var n=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(n=n.setEndPosition(n.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&n.startLineNumbere.endLineNumber+1?(i.push(e),t):new Ii(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn):t.startLineNumber>e.endLineNumber?(i.push(e),t):new Ii(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)});i.push(o);for(var s=t.getModel(),a=[],u=[],l=r,c=0,h=0,d=i.length;h=1){var E=!0;""===_&&(E=!1),!E||" "!==_.charAt(_.length-1)&&"\t"!==_.charAt(_.length-1)||(E=!1,_=_.replace(/[\s\uFEFF\xA0]+$/g," "));var A=w.substr(D-1);_+=(E?" ":"")+A,v=E?A.length+1:A.length}else v=0}var S=new be(f,1,g,m);if(!S.isEmpty()){var x=void 0;p.isEmpty()?(a.push(S_.replace(S,_)),x=new Ii(S.startLineNumber-c,_.length-v+1,f-c,_.length-v+1)):p.startLineNumber===p.endLineNumber?(a.push(S_.replace(S,_)),x=new Ii(p.startLineNumber-c,p.startColumn,p.endLineNumber-c,p.endColumn)):(a.push(S_.replace(S,_)),x=new Ii(p.startLineNumber-c,p.startColumn,p.startLineNumber-c,_.length-y)),null!==be.intersectRanges(S,r)?l=x:u.push(x)}c+=S.endLineNumber-S.startLineNumber}u.unshift(l),t.pushUndoStop(),t.executeEdits(this.id,a,u),t.pushUndoStop()},t}(qu),MS=function(e){function t(){return e.call(this,{id:"editor.action.transpose",label:ns("editor.transpose","Transpose characters around the cursor"),alias:"Transpose characters around the cursor",precondition:nl.writable})||this}return uS(t,e),t.prototype.run=function(e,t){for(var n=t.getSelections(),r=t.getModel(),i=[],o=0,s=n.length;o=l){if(u.lineNumber===r.getLineCount())continue;var c=new be(u.lineNumber,Math.max(1,u.column-1),u.lineNumber+1,1),h=r.getValueInRange(c).split("").reverse().join("");i.push(new hl(new Ii(u.lineNumber,Math.max(1,u.column-1),u.lineNumber+1,1),h))}else{c=new be(u.lineNumber,Math.max(1,u.column-1),u.lineNumber,u.column+1),h=r.getValueInRange(c).split("").reverse().join("");i.push(new fl(c,h,new Ii(u.lineNumber,u.column+1,u.lineNumber,u.column+1)))}}}t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()},t}(qu),NS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return uS(t,e),t.prototype.run=function(e,t){for(var n=t.getSelections(),r=t.getModel(),i=[],o=0,s=n.length;o=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},HS=function(e,t){return function(n,r){t(n,r,e)}},US=(new Mw).appendText(we.d?ns("links.navigate.mac","Cmd + click to follow link"):ns("links.navigate","Ctrl + click to follow link")),YS=(new Mw).appendText(we.d?ns("links.command.mac","Cmd + click to execute command"):ns("links.command","Ctrl + click to execute command")),ZS=(new Mw).appendText(we.d?ns("links.navigate.al.mac","Option + click to follow link"):ns("links.navigate.al","Alt + click to follow link")),GS=(new Mw).appendText(we.d?ns("links.command.al.mac","Option + click to execute command"):ns("links.command.al","Alt + click to execute command")),KS={meta:Ma.register({stickiness:Pn.NeverGrowsWhenTypingAtEdges,inlineClassName:"detected-link",hoverMessage:US}),metaActive:Ma.register({stickiness:Pn.NeverGrowsWhenTypingAtEdges,inlineClassName:"detected-link-active",hoverMessage:US}),alt:Ma.register({stickiness:Pn.NeverGrowsWhenTypingAtEdges,inlineClassName:"detected-link",hoverMessage:ZS}),altActive:Ma.register({stickiness:Pn.NeverGrowsWhenTypingAtEdges,inlineClassName:"detected-link-active",hoverMessage:ZS}),altCommand:Ma.register({stickiness:Pn.NeverGrowsWhenTypingAtEdges,inlineClassName:"detected-link",hoverMessage:GS}),altCommandActive:Ma.register({stickiness:Pn.NeverGrowsWhenTypingAtEdges,inlineClassName:"detected-link-active",hoverMessage:GS}),metaCommand:Ma.register({stickiness:Pn.NeverGrowsWhenTypingAtEdges,inlineClassName:"detected-link",hoverMessage:YS}),metaCommandActive:Ma.register({stickiness:Pn.NeverGrowsWhenTypingAtEdges,inlineClassName:"detected-link-active",hoverMessage:YS})},qS=function(){function e(e,t){this.link=e,this.decorationId=t}return e.decoration=function(t,n){return{range:t.range,options:e._getOptions(t,n,!1)}},e._getOptions=function(e,t,n){return/^command:/i.test(e.url)?t?n?KS.metaCommandActive:KS.metaCommand:n?KS.altCommandActive:KS.altCommand:t?n?KS.metaActive:KS.meta:n?KS.altActive:KS.alt},e.prototype.activate=function(t,n){t.changeDecorationOptions(this.decorationId,e._getOptions(this.link,n,!0))},e.prototype.deactivate=function(t,n){t.changeDecorationOptions(this.decorationId,e._getOptions(this.link,n,!1))},e}(),QS=function(){function e(e,t,n){var r=this;this.editor=e,this.openerService=t,this.notificationService=n,this.listenersToRemove=[];var i=new zS(e);this.listenersToRemove.push(i),this.listenersToRemove.push(i.onMouseMoveOrRelevantKeyDown(function(e){var t=e[0],n=e[1];r._onEditorMouseMove(t,n)})),this.listenersToRemove.push(i.onExecute(function(e){r.onEditorMouseUp(e)})),this.listenersToRemove.push(i.onCancel(function(e){r.cleanUpActiveLinkDecoration()})),this.enabled=e.getConfiguration().contribInfo.links,this.listenersToRemove.push(e.onDidChangeConfiguration(function(t){var n=e.getConfiguration().contribInfo.links;r.enabled!==n&&(r.enabled=n,r.updateDecorations([]),r.stop(),r.beginCompute())})),this.listenersToRemove.push(e.onDidChangeModelContent(function(e){return r.onChange()})),this.listenersToRemove.push(e.onDidChangeModel(function(e){return r.onModelChanged()})),this.listenersToRemove.push(e.onDidChangeModelLanguage(function(e){return r.onModelModeChanged()})),this.listenersToRemove.push(Ei.onDidChange(function(e){return r.onModelModeChanged()})),this.timeoutPromise=null,this.computePromise=null,this.currentOccurrences={},this.activeLinkDecorationId=null,this.beginCompute()}return e.get=function(t){return t.getContribution(e.ID)},e.prototype.getId=function(){return e.ID},e.prototype.onModelChanged=function(){this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.beginCompute()},e.prototype.onModelModeChanged=function(){this.stop(),this.beginCompute()},e.prototype.onChange=function(){var t=this;this.timeoutPromise||(this.timeoutPromise=cn.b.timeout(e.RECOMPUTE_TIME),this.timeoutPromise.then(function(){t.timeoutPromise=null,t.beginCompute()}))},e.prototype.beginCompute=function(){var e=this;this.editor.getModel()&&this.enabled&&Ei.has(this.editor.getModel())&&(this.computePromise=TS(this.editor.getModel()).then(function(t){e.updateDecorations(t),e.computePromise=null}))},e.prototype.updateDecorations=function(e){for(var t="altKey"===this.editor.getConfiguration().multiCursorModifier,n=[],r=Object.keys(this.currentOccurrences),i=0,o=r.length;i1&&n.push(new Ii(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}},t.prototype.run=function(e,t){var n=this,r=t.getModel(),i=[];t.getSelections().forEach(function(e){return n.getCursorsForSelection(e,r,i)}),i.length>0&&t.setSelections(i)},t}(qu),nx=function(){return function(e,t,n){this.selections=e,this.revealRange=t,this.revealScrollType=n}}(),rx=function(){function e(e,t,n,r,i,o,s){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=r,this.wholeWord=i,this.matchCase=o,this.currentMatch=s}return e.create=function(t,n){var r=n.getState();if(!t.isFocused()&&r.isRevealed&&r.searchString.length>0)return new e(t,n,!1,r.searchString,r.wholeWord,r.matchCase,null);var i,o,s=!1,a=t.getSelections();1===a.length&&a[0].isEmpty()?(s=!0,i=!0,o=!0):(i=r.wholeWord,o=r.matchCase);var u,l=t.getSelection(),c=null;if(l.isEmpty()){var h=t.getModel().getWordAtPosition(l.getStartPosition());if(!h)return null;u=h.word,c=new Ii(l.startLineNumber,h.startColumn,l.startLineNumber,h.endColumn)}else u=t.getModel().getValueInRange(l).replace(/\r\n/g,"\n");return new e(t,n,s,u,i,o,c)},e.prototype.addSelectionToNextFindMatch=function(){var e=this._getNextMatch();if(!e)return null;var t=this._editor.getSelections();return new nx(t.concat(e),e,0)},e.prototype.moveSelectionToNextFindMatch=function(){var e=this._getNextMatch();if(!e)return null;var t=this._editor.getSelections();return new nx(t.slice(0,t.length-1).concat(e),e,0)},e.prototype._getNextMatch=function(){if(this.currentMatch){var e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();var t=this._editor.getSelections(),n=t[t.length-1],r=this._editor.getModel().findNextMatch(this.searchText,n.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1);return r?new Ii(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn):null},e.prototype.addSelectionToPreviousFindMatch=function(){var e=this._getPreviousMatch();if(!e)return null;var t=this._editor.getSelections();return new nx(t.concat(e),e,0)},e.prototype.moveSelectionToPreviousFindMatch=function(){var e=this._getPreviousMatch();if(!e)return null;var t=this._editor.getSelections();return new nx(t.slice(0,t.length-1).concat(e),e,0)},e.prototype._getPreviousMatch=function(){if(this.currentMatch){var e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();var t=this._editor.getSelections(),n=t[t.length-1],r=this._editor.getModel().findPreviousMatch(this.searchText,n.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1);return r?new Ii(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn):null},e.prototype.selectAll=function(){return this.findController.highlightFindOptions(),this._editor.getModel().findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1,1073741824)},e}(),ix=function(e){function t(t){var n=e.call(this)||this;return n._editor=t,n._ignoreSelectionChange=!1,n._session=null,n._sessionDispose=[],n}return JS(t,e),t.get=function(e){return e.getContribution(t.ID)},t.prototype.dispose=function(){this._endSession(),e.prototype.dispose.call(this)},t.prototype.getId=function(){return t.ID},t.prototype._beginSessionIfNeeded=function(e){var t=this;if(!this._session){var n=rx.create(this._editor,e);if(!n)return;this._session=n;var r={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(r.wholeWordOverride=1,r.matchCaseOverride=1,r.isRegexOverride=2),e.getState().change(r,!1),this._sessionDispose=[this._editor.onDidChangeCursorSelection(function(e){t._ignoreSelectionChange||t._endSession()}),this._editor.onDidBlurEditorText(function(){t._endSession()}),e.getState().onFindReplaceStateChange(function(e){(e.matchCase||e.wholeWord)&&t._endSession()})]}},t.prototype._endSession=function(){if(this._sessionDispose=on(this._sessionDispose),this._session&&this._session.isDisconnectedFromFindController){this._session.findController.getState().change({wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0},!1)}this._session=null},t.prototype._setSelections=function(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1},t.prototype._expandEmptyToWord=function(e,t){if(!t.isEmpty())return t;var n=e.getWordAtPosition(t.getStartPosition());return n?new Ii(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):t},t.prototype._applySessionResult=function(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))},t.prototype.getSession=function(e){return this._session},t.prototype.addSelectionToNextFindMatch=function(e){if(!this._session){var t=this._editor.getSelections();if(t.length>1){var n=e.getState().matchCase;if(!fx(this._editor.getModel(),t,n)){for(var r=this._editor.getModel(),i=[],o=0,s=t.length;o0&&n.isRegex)t=this._editor.getModel().findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getConfiguration().wordSeparators:null,!1,1073741824);else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll()}if(t.length>0){for(var r=this._editor.getSelection(),i=0,o=t.length;i1){var u=o.getState().matchCase;if(!fx(t.getModel(),a,u))return null}s=rx.create(t,o)}if(!s)return null;var l=null,c=gi.has(n);if(s.currentMatch){if(c)return null;if(!t.getConfiguration().contribInfo.occurrencesHighlight)return null;l=s.currentMatch}if(/^[ \t]+$/.test(s.searchText))return null;if(s.searchText.length>200)return null;var h=o.getState(),d=h.matchCase;if(h.isRevealed){var p=h.searchString;d||(p=p.toLowerCase());var f=s.searchText;if(d||(f=f.toLowerCase()),p===f&&s.matchCase===h.matchCase&&s.wholeWord===h.wholeWord&&!h.isRegex)return null}return new dx(l,s.searchText,s.matchCase,s.wholeWord?t.getConfiguration().wordSeparators:null)},t.prototype._setState=function(e){if(dx.softEquals(this.state,e))this.state=e;else if(this.state=e,this.state){var n=this.editor.getModel();if(!n.isTooLargeForTokenization()){var r=gi.has(n),i=n.findMatches(this.state.searchText,!0,!1,this.state.matchCase,this.state.wordSeparators,!1).map(function(e){return e.range});i.sort(be.compareRangesUsingStarts);var o=this.editor.getSelections();o.sort(be.compareRangesUsingStarts);for(var s=[],a=0,u=0,l=i.length,c=o.length;a=c)s.push(h),a++;else{var d=be.compareRangesUsingStarts(h,o[u]);d<0?(s.push(h),a++):d>0?u++:(a++,u++)}}var p=s.map(function(e){return{range:e,options:r?t._SELECTION_HIGHLIGHT:t._SELECTION_HIGHLIGHT_OVERVIEW}});this.decorations=this.editor.deltaDecorations(this.decorations,p)}}else this.decorations=this.editor.deltaDecorations(this.decorations,[])},t.prototype.dispose=function(){this._setState(null),e.prototype.dispose.call(this)},t.ID="editor.contrib.selectionHighlighter",t._SELECTION_HIGHLIGHT_OVERVIEW=Ma.register({stickiness:Pn.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight",overviewRuler:{color:Pg(Ng),darkColor:Pg(Ng),position:Ln.Center}}),t._SELECTION_HIGHLIGHT=Ma.register({stickiness:Pn.NeverGrowsWhenTypingAtEdges,className:"selectionHighlight"}),t}(un);function fx(e,t,n){for(var r=gx(e,t[0],!n),i=1,o=t.length;i=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},yx=function(e,t){return function(n,r){t(n,r,e)}},bx=function(e){function t(t,n,r,i,o,s,a,u){return e.call(this,t,n,!1,r,i,o,s,a,u)||this}return mx(t,e),t.prototype._getContributions=function(){return Gu.getEditorContributions()},t.prototype._getActions=function(){return Gu.getEditorActions()},t=vx([yx(2,Tr),yx(3,Wu),yx(4,Za),yx(5,Su),yx(6,Og),yx(7,Yb)],t)}(Xb),_x=(n(353),n(354),function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Cx=function(){function e(e,t,n,r){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=n,this.modifiedLineEnd=r}return e.prototype.getType=function(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0},e}(),wx=function(){return function(e){this.entries=e}}(),Dx=function(e){function t(t){var n=e.call(this)||this;return n._width=0,n._diffEditor=t,n._isVisible=!1,n.shadow=Up(document.createElement("div")),n.shadow.setClassName("diff-review-shadow"),n.actionBarContainer=Up(document.createElement("div")),n.actionBarContainer.setClassName("diff-review-actions"),n._actionBar=n._register(new zC(n.actionBarContainer.domNode)),n._actionBar.push(new hu("diffreview.close",ns("label.close","Close"),"close-diff-review",!0,function(){return n.hide(),null}),{label:!1,icon:!0}),n.domNode=Up(document.createElement("div")),n.domNode.setClassName("diff-review monaco-editor-background"),n._content=Up(document.createElement("div")),n._content.setClassName("diff-review-content"),n.scrollbar=n._register(new bb(n._content.domNode,{})),n.domNode.domNode.appendChild(n.scrollbar.getDomNode()),n._register(t.onDidUpdateDiff(function(){n._isVisible&&(n._diffs=n._compute(),n._render())})),n._register(t.getModifiedEditor().onDidChangeCursorPosition(function(){n._isVisible&&n._render()})),n._register(t.getOriginalEditor().onDidFocusEditor(function(){n._isVisible&&n.hide()})),n._register(t.getModifiedEditor().onDidFocusEditor(function(){n._isVisible&&n.hide()})),n._register(Tc(n.domNode.domNode,"click",function(e){e.preventDefault();var t=ah(e.target,"diff-review-row");t&&n._goToRow(t)})),n._register(Tc(n.domNode.domNode,"keydown",function(e){(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),n._goToRow(n._getNextRow())),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),n._goToRow(n._getPrevRow())),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),n.hide()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),n.accept())})),n._diffs=[],n._currentDiff=null,n}return _x(t,e),t.prototype.prev=function(){var e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){for(var t=-1,n=0,r=this._diffs.length;n0){var y=e[o-1];m=0===y.originalEndLineNumber?y.originalStartLineNumber+1:y.originalEndLineNumber+1,v=0===y.modifiedEndLineNumber?y.modifiedStartLineNumber+1:y.modifiedEndLineNumber+1}var b=f-3+1,_=g-3+1;if(bD)x+=S=D-x,M+=S;if(M>E)x+=S=E-M,M+=S;d[p++]=new Cx(C,x,w,M),r[i++]=new wx(d)}var N=r[0].entries,I=[],L=0;for(o=1,s=r.length;od)&&(d=y),0!==b&&(0===p||bf)&&(f=_)}var C=document.createElement("div");C.className="diff-review-row";var w=document.createElement("div");w.className="diff-review-cell diff-review-summary";var D=d-h+1,E=f-p+1;w.appendChild(document.createTextNode(u+1+"/"+this._diffs.length+": @@ -"+h+","+D+" +"+p+","+E+" @@")),C.setAttribute("data-line",String(p));var A=function(e){return 0===e?ns("no_lines","no lines"):1===e?ns("one_line","1 line"):ns("more_lines","{0} lines",e)},S=A(D),x=A(E);C.setAttribute("aria-label",ns({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines", "1 line" or "X lines", localized separately.']},"Difference {0} of {1}: original {2}, {3}, modified {4}, {5}",u+1,this._diffs.length,h,S,p,x)),C.appendChild(w),C.setAttribute("role","listitem"),c.appendChild(C);var M=p;for(g=0,m=l.length;g=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Nx=function(e,t){return function(n,r){t(n,r,e)}},Ix=function(){function e(){this._zones=[],this._zonesMap={},this._decorations=[]}return e.prototype.getForeignViewZones=function(e){var t=this;return e.filter(function(e){return!t._zonesMap[String(e.id)]})},e.prototype.clean=function(e){var t=this;this._zones.length>0&&e.changeViewZones(function(e){for(var n=0,r=t._zones.length;n0?i/n:0;return{height:Math.max(0,Math.floor(e.contentHeight*o)),top:Math.floor(t*o)}},t.prototype._createDataSource=function(){var e=this;return{getWidth:function(){return e._width},getHeight:function(){return e._height-e._reviewHeight},getContainerDomNode:function(){return e._containerDomElement},relayoutEditors:function(){e._doLayout()},getOriginalEditor:function(){return e.originalEditor},getModifiedEditor:function(){return e.modifiedEditor}}},t.prototype._setStrategy=function(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getTheme()),this._lineChanges&&this._updateDecorations(),this._measureDomElement(!0)},t.prototype._getLineChangeAtOrBeforeLineNumber=function(e,t){if(0===this._lineChanges.length||e=s?n=i+1:(n=i,r=i)}return this._lineChanges[n]},t.prototype._getEquivalentLineForOriginalLineNumber=function(e){var t=this._getLineChangeAtOrBeforeLineNumber(e,function(e){return e.originalStartLineNumber});if(!t)return e;var n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),r=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),i=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,o=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-n;return s<=i?r+Math.min(s,o):r+o-i+s},t.prototype._getEquivalentLineForModifiedLineNumber=function(e){var t=this._getLineChangeAtOrBeforeLineNumber(e,function(e){return e.modifiedStartLineNumber});if(!t)return e;var n=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),r=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),i=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,o=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,s=e-r;return s<=o?n+Math.min(s,i):n+i-o+s},t.prototype.getDiffLineInformationForOriginal=function(e){return this._lineChanges?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null},t.prototype.getDiffLineInformationForModified=function(e){return this._lineChanges?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null},t.ONE_OVERVIEW_WIDTH=15,t.ENTIRE_DIFF_OVERVIEW_WIDTH=30,t.UPDATE_DIFF_DECORATIONS_DELAY=200,t=Mx([Nx(2,uE),Nx(3,Su),Nx(4,Tr),Nx(5,Wu),Nx(6,Og),Nx(7,Yb)],t)}(un),Tx=function(e){function t(t){var n=e.call(this)||this;return n._dataSource=t,n}return xx(t,e),t.prototype.applyColors=function(e){var t=(e.getColor(mg)||fg).transparent(2),n=(e.getColor(vg)||gg).transparent(2),r=!t.equals(this._insertColor)||!n.equals(this._removeColor);return this._insertColor=t,this._removeColor=n,r},t.prototype.getEditorsDiffDecorations=function(e,t,n,r,i,o,s){i=i.sort(function(e,t){return e.afterLineNumber-t.afterLineNumber}),r=r.sort(function(e,t){return e.afterLineNumber-t.afterLineNumber});var a=this._getViewZones(e,r,i,o,s,n),u=this._getOriginalEditorDecorations(e,t,n,o,s),l=this._getModifiedEditorDecorations(e,t,n,o,s);return{original:{decorations:u.decorations,overviewZones:u.overviewZones,zones:a.original},modified:{decorations:l.decorations,overviewZones:l.overviewZones,zones:a.modified}}},t.prototype._getViewZones=function(e,t,n,r,i,o){return null},t.prototype._getOriginalEditorDecorations=function(e,t,n,r,i){return null},t.prototype._getModifiedEditorDecorations=function(e,t,n,r,i){return null},t}(un),Fx=function(){function e(e){this._source=e,this._index=-1,this.advance()}return e.prototype.advance=function(){this._index++,this._index0){var n=e[e.length-1];if(n.afterLineNumber===t.afterLineNumber&&null===n.domNode)return void(n.heightInLines+=t.heightInLines)}e.push(t)},l=new Fx(this.modifiedForeignVZ),c=new Fx(this.originalForeignVZ),h=0,d=this.lineChanges.length;h<=d;h++){var p=h0?-1:0),i=p.modifiedStartLineNumber+(p.modifiedEndLineNumber>0?-1:0),n=p.originalEndLineNumber>0?p.originalEndLineNumber-p.originalStartLineNumber+1:0,t=p.modifiedEndLineNumber>0?p.modifiedEndLineNumber-p.modifiedStartLineNumber+1:0,o=Math.max(p.originalStartLineNumber,p.originalEndLineNumber),s=Math.max(p.modifiedStartLineNumber,p.modifiedEndLineNumber)):(o=r+=1e7+n,s=i+=1e7+t);for(var f,g=[],m=[];l.current&&l.current.afterLineNumber<=s;){var v=void 0;v=l.current.afterLineNumber<=i?r-i+l.current.afterLineNumber:o,g.push({afterLineNumber:v,heightInLines:l.current.heightInLines,domNode:null}),l.advance()}for(;c.current&&c.current.afterLineNumber<=o;){v=void 0;v=c.current.afterLineNumber<=r?i-r+c.current.afterLineNumber:s,m.push({afterLineNumber:v,heightInLines:c.current.heightInLines,domNode:null}),c.advance()}if(null!==p&&Vx(p))(f=this._produceOriginalFromDiff(p,n,t))&&g.push(f);if(null!==p&&Hx(p))(f=this._produceModifiedFromDiff(p,n,t))&&m.push(f);var y=0,b=0;for(g=g.sort(a),m=m.sort(a);y=C.heightInLines?(_.heightInLines-=C.heightInLines,b++):(C.heightInLines-=_.heightInLines,y++)}for(;y2*t.MINIMUM_EDITOR_WIDTH?(rn-t.MINIMUM_EDITOR_WIDTH&&(r=n-t.MINIMUM_EDITOR_WIDTH)):r=i,this._sashPosition!==r&&(this._sashPosition=r,this._sash.layout()),this._sashPosition},t.prototype.onSashDragStart=function(){this._startSashPosition=this._sashPosition},t.prototype.onSashDrag=function(e){var t=this._dataSource.getWidth()-kx.ENTIRE_DIFF_OVERVIEW_WIDTH,n=this.layout((this._startSashPosition+(e.currentX-e.startX))/t);this._sashRatio=n/t,this._dataSource.relayoutEditors()},t.prototype.onSashDragEnd=function(){this._sash.layout()},t.prototype.onSashReset=function(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()},t.prototype.getVerticalSashTop=function(e){return 0},t.prototype.getVerticalSashLeft=function(e){return this._sashPosition},t.prototype.getVerticalSashHeight=function(e){return this._dataSource.getHeight()},t.prototype._getViewZones=function(e,t,n,r,i){return new jx(e,t,n).getViewZones()},t.prototype._getOriginalEditorDecorations=function(e,t,n,r,i){for(var o=this._removeColor.toString(),s={decorations:[],overviewZones:[]},a=r.getModel(),u=0,l=e.length;ut?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:n-t,domNode:null}:null},t.prototype._produceModifiedFromDiff=function(e,t,n){return t>n?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-n,domNode:null}:null},t}(Ox),zx=function(e){function t(t,n){var r=e.call(this,t)||this;return r.decorationsLeft=t.getOriginalEditor().getLayoutInfo().decorationsLeft,r._register(t.getOriginalEditor().onDidLayoutChange(function(e){r.decorationsLeft!==e.decorationsLeft&&(r.decorationsLeft=e.decorationsLeft,t.relayoutEditors())})),r}return xx(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.setEnableSplitViewResizing=function(e){},t.prototype._getViewZones=function(e,t,n,r,i,o){return new Wx(e,t,n,r,i,o).getViewZones()},t.prototype._getOriginalEditorDecorations=function(e,t,n,r,i){for(var o=this._removeColor.toString(),s={decorations:[],overviewZones:[]},a=0,u=e.length;a'])}var p=document.createElement("div");p.className="view-lines line-delete",p.innerHTML=a.build(),Vp.applyFontInfoSlow(p,this.modifiedEditorConfiguration.fontInfo);var f=document.createElement("div");return f.className="inline-deleted-margin-view-zone",f.innerHTML=u.join(""),Vp.applyFontInfoSlow(f,this.modifiedEditorConfiguration.fontInfo),{shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,domNode:p,marginDomNode:f}},t.prototype.renderOriginalLine=function(e,t,n,r,i,o,s){var a=t.getLineContent(i),u=Hm.filter(o,i,1,a.length+1),l=new Uint32Array(2);l[0]=a.length,l[1]=16793600;var c=new Go(l,a);s.appendASCIIString('
    ');var h=od.isBasicASCII(a,t.mightContainNonBasicASCII()),d=od.containsRTL(a,h,t.mightContainRTL());$m(new Qm(n.fontInfo.isMonospace&&!n.viewInfo.disableMonospaceOptimizations,a,h,d,0,c,u,r,n.fontInfo.spaceWidth,n.viewInfo.stopRenderingLineAfter,n.viewInfo.renderWhitespace,n.viewInfo.renderControlCharacters,n.viewInfo.fontLigatures),s),s.appendASCIIString("
    ")},t}(Ox);function Vx(e){return e.modifiedEndLineNumber>0}function Hx(e){return e.originalEndLineNumber>0}Vg(function(e,t){var n=e.getColor(mg);n&&(t.addRule(".monaco-editor .line-insert, .monaco-editor .char-insert { background-color: "+n+"; }"),t.addRule(".monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: "+n+"; }"),t.addRule(".monaco-editor .inline-added-margin-view-zone { background-color: "+n+"; }"));var r=e.getColor(vg);r&&(t.addRule(".monaco-editor .line-delete, .monaco-editor .char-delete { background-color: "+r+"; }"),t.addRule(".monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: "+r+"; }"),t.addRule(".monaco-editor .inline-deleted-margin-view-zone { background-color: "+r+"; }"));var i=e.getColor(yg);i&&t.addRule(".monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+i+"; }");var o=e.getColor(bg);o&&t.addRule(".monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px "+("hc"===e.type?"dashed":"solid")+" "+o+"; }");var s=e.getColor(Yf);s&&t.addRule(".monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px "+s+"; }")});var Ux,Yx,Zx=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gx=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Kx=function(e,t){return function(n,r){t(n,r,e)}},qx=function(e){function t(t,n,r,i,o,s,a,u,l){var c=e.call(this,t,r.getRawConfiguration(),i,o,s,a,u,l)||this;return c._parentEditor=r,c._overwriteOptions=n,e.prototype.updateOptions.call(c,c._overwriteOptions),c._register(r.onDidChangeConfiguration(function(e){return c._onParentConfigurationChanged(e)})),c}return Zx(t,e),t.prototype.getParentEditor=function(){return this._parentEditor},t.prototype._onParentConfigurationChanged=function(t){e.prototype.updateOptions.call(this,this._parentEditor.getRawConfiguration()),e.prototype.updateOptions.call(this,this._overwriteOptions)},t.prototype.updateOptions=function(t){ds(this._overwriteOptions,t,!0),e.prototype.updateOptions.call(this,this._overwriteOptions)},t=Gx([Kx(3,Tr),Kx(4,Wu),Kx(5,Za),Kx(6,Su),Kx(7,Og),Kx(8,Yb)],t)}(bx),Qx=(function(e){function t(t,n,r,i,o,s,a,u,l){var c=e.call(this,t,r.getRawConfiguration(),i,o,s,a,u,l)||this;return c._parentEditor=r,c._overwriteOptions=n,e.prototype.updateOptions.call(c,c._overwriteOptions),c._register(r.onDidChangeConfiguration(function(e){return c._onParentConfigurationChanged(e)})),c}Zx(t,e),t.prototype.getParentEditor=function(){return this._parentEditor},t.prototype._onParentConfigurationChanged=function(t){e.prototype.updateOptions.call(this,this._parentEditor.getRawConfiguration()),e.prototype.updateOptions.call(this,this._overwriteOptions)},t.prototype.updateOptions=function(t){ds(this._overwriteOptions,t,!0),e.prototype.updateOptions.call(this,this._overwriteOptions)},t=Gx([Kx(3,uE),Kx(4,Su),Kx(5,Tr),Kx(6,Wu),Kx(7,Og),Kx(8,Yb)],t)}(kx),function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}());(Yx=Ux||(Ux={})).inPeekEditor=new Au("inReferenceSearchEditor",!0),Yx.notInPeekEditor=Yx.inPeekEditor.toNegated();var Xx={headerBackgroundColor:md.white,primaryHeadingColor:md.fromHex("#333333"),secondaryHeadingColor:md.fromHex("#6c6c6cb3")},Jx=function(e){function t(t,n){void 0===n&&(n={});var r=e.call(this,t,n)||this;return r._onDidClose=new wn,ds(r.options,Xx,!1),r}return Qx(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._onDidClose.fire(this)},Object.defineProperty(t.prototype,"onDidClose",{get:function(){return this._onDidClose.event},enumerable:!0,configurable:!0}),t.prototype.style=function(t){var n=this.options;t.headerBackgroundColor&&(n.headerBackgroundColor=t.headerBackgroundColor),t.primaryHeadingColor&&(n.primaryHeadingColor=t.primaryHeadingColor),t.secondaryHeadingColor&&(n.secondaryHeadingColor=t.secondaryHeadingColor),e.prototype.style.call(this,t)},t.prototype._applyStyles=function(){e.prototype._applyStyles.call(this);var t=this.options;this._headElement&&(this._headElement.style.backgroundColor=t.headerBackgroundColor.toString()),this._primaryHeading&&(this._primaryHeading.style.color=t.primaryHeadingColor.toString()),this._secondaryHeading&&(this._secondaryHeading.style.color=t.secondaryHeadingColor.toString()),this._bodyElement&&(this._bodyElement.style.borderColor=t.frameColor.toString())},t.prototype._fillContainer=function(e){this.setCssClass("peekview-widget"),this._headElement=Z_(".head").getHTMLElement(),this._bodyElement=Z_(".body").getHTMLElement(),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)},t.prototype._fillHead=function(e){var t=this,n=Z_(".peekview-title").on(ph.CLICK,function(e){return t._onTitleClick(e)}).appendTo(this._headElement).getHTMLElement();this._primaryHeading=Z_("span.filename").appendTo(n).getHTMLElement(),this._secondaryHeading=Z_("span.dirname").appendTo(n).getHTMLElement(),this._metaHeading=Z_("span.meta").appendTo(n).getHTMLElement();var r=Z_(".peekview-actions").appendTo(this._headElement),i=this._getActionBarOptions();this._actionbarWidget=new zC(r.getHTMLElement(),i),this._disposables.push(this._actionbarWidget),this._actionbarWidget.push(new hu("peekview.close",ns("label.close","Close"),"close-peekview-action",!0,function(){return t.dispose(),null}),{label:!1,icon:!0})},t.prototype._getActionBarOptions=function(){return{}},t.prototype._onTitleClick=function(e){},t.prototype.setTitle=function(e,t){Z_(this._primaryHeading).safeInnerHtml(e),this._primaryHeading.setAttribute("aria-label",e),t?Z_(this._secondaryHeading).safeInnerHtml(t):Dc(this._secondaryHeading)},t.prototype.setMetaTitle=function(e){e?Z_(this._metaHeading).safeInnerHtml(e):Dc(this._metaHeading)},t.prototype._doLayout=function(e,t){if(!this._isShowing&&e<0)this.dispose();else{var n=Math.ceil(1.2*this.editor.getConfiguration().lineHeight),r=e-(n+2);this._doLayoutHead(n,t),this._doLayoutBody(r,t)}},t.prototype._doLayoutHead=function(e,t){this._headElement.style.height=$e("{0}px",e),this._headElement.style.lineHeight=this._headElement.style.height},t.prototype._doLayoutBody=function(e,t){this._bodyElement.style.height=$e("{0}px",e)},t}(NE);function $x(e,t,n){return e.scheme===t.scheme&&e.authority===t.authority&&("file"===e.scheme?ar(e.fsPath,t.fsPath,n):ar(e.path,t.path,n))}var eM,tM,nM,rM=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),iM=Or("fileService");!function(e){e[e.Unknown=0]="Unknown",e[e.File=1]="File",e[e.Directory=2]="Directory",e[e.SymbolicLink=64]="SymbolicLink"}(eM||(eM={})),function(e){e[e.FileReadWrite=2]="FileReadWrite",e[e.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",e[e.FileFolderCopy=8]="FileFolderCopy",e[e.PathCaseSensitive=1024]="PathCaseSensitive"}(tM||(tM={})),function(e){e[e.CREATE=0]="CREATE",e[e.DELETE=1]="DELETE",e[e.MOVE=2]="MOVE",e[e.COPY=3]="COPY"}(nM||(nM={}));var oM;!function(){function e(e,t,n){this._resource=e,this._operation=t,this._target=n}Object.defineProperty(e.prototype,"resource",{get:function(){return this._resource},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"operation",{get:function(){return this._operation},enumerable:!0,configurable:!0})}();!function(e){e[e.UPDATED=0]="UPDATED",e[e.ADDED=1]="ADDED",e[e.DELETED=2]="DELETED"}(oM||(oM={}));!function(){function e(e){this._changes=e}Object.defineProperty(e.prototype,"changes",{get:function(){return this._changes},enumerable:!0,configurable:!0}),e.prototype.contains=function(e,t){return!!e&&this._changes.some(function(n){return n.type===t&&(t===oM.DELETED?$x(e,n.resource,!we.c):(r=e,i=n.resource,o=!we.c,!(r!==i)||!(!r||!i)&&(o?xt(r.toString(),i.toString()):r.toString()===i.toString())));var r,i,o})},e.prototype.getAdded=function(){return this.getOfType(oM.ADDED)},e.prototype.gotAdded=function(){return this.hasType(oM.ADDED)},e.prototype.getDeleted=function(){return this.getOfType(oM.DELETED)},e.prototype.gotDeleted=function(){return this.hasType(oM.DELETED)},e.prototype.getUpdated=function(){return this.getOfType(oM.UPDATED)},e.prototype.gotUpdated=function(){return this.hasType(oM.UPDATED)},e.prototype.getOfType=function(e){return this._changes.filter(function(t){return t.type===e})},e.prototype.hasType=function(e){return this._changes.some(function(t){return t.type===e})}}();!function(){function e(e){this._value=e}e.prototype.read=function(){var e=this._value;return this._value=null,e}}();var sM;!function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.fileOperationResult=n,i.options=r,i}rM(t,e),t.isFileOperationError=function(e){return e instanceof Error&&!Kr(e.fileOperationResult)}}(Error);!function(e){e[e.FILE_IS_BINARY=0]="FILE_IS_BINARY",e[e.FILE_IS_DIRECTORY=1]="FILE_IS_DIRECTORY",e[e.FILE_NOT_FOUND=2]="FILE_NOT_FOUND",e[e.FILE_NOT_MODIFIED_SINCE=3]="FILE_NOT_MODIFIED_SINCE",e[e.FILE_MODIFIED_SINCE=4]="FILE_MODIFIED_SINCE",e[e.FILE_MOVE_CONFLICT=5]="FILE_MOVE_CONFLICT",e[e.FILE_READ_ONLY=6]="FILE_READ_ONLY",e[e.FILE_PERMISSION_DENIED=7]="FILE_PERMISSION_DENIED",e[e.FILE_TOO_LARGE=8]="FILE_TOO_LARGE",e[e.FILE_INVALID_PATH=9]="FILE_INVALID_PATH",e[e.FILE_EXCEED_MEMORY_LIMIT=10]="FILE_EXCEED_MEMORY_LIMIT"}(sM||(sM={}));var aM;!function(e){e[e.FILE=0]="FILE",e[e.FOLDER=1]="FOLDER",e[e.ROOT_FOLDER=2]="ROOT_FOLDER"}(aM||(aM={}));Or("workspacesMainService"),Or("workspacesService");var uM="code-workspace";ns("codeWorkspace","Code Workspace");var lM,cM=Or("contextService");!function(e){e[e.EMPTY=1]="EMPTY",e[e.FOLDER=2]="FOLDER",e[e.WORKSPACE=3]="WORKSPACE"}(lM||(lM={}));!function(){function e(e,t,n,r,i){void 0===t&&(t=""),void 0===n&&(n=[]),void 0===r&&(r=null),this._id=e,this._name=t,this._configuration=r,this._ctime=i,this._foldersMap=Ze.forPaths(),this.folders=n}e.prototype.update=function(e){this._id=e.id,this._name=e.name,this._configuration=e.configuration,this._ctime=e.ctime,this.folders=e.folders},Object.defineProperty(e.prototype,"folders",{get:function(){return this._folders},set:function(e){this._folders=e,this.updateFoldersMap()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ctime",{get:function(){return this._ctime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"configuration",{get:function(){return this._configuration},set:function(e){this._configuration=e},enumerable:!0,configurable:!0}),e.prototype.getFolder=function(e){return e?this._foldersMap.findSubstr(e.toString()):null},e.prototype.updateFoldersMap=function(){this._foldersMap=Ze.forPaths();for(var e=0,t=this.folders;e"),t.push(fM(this.text.substring(n,e.start))),t.push(""),n=e.end),t.push(''),t.push(fM(this.text.substring(e.start,e.end))),t.push(""),n=e.end);n"),t.push(fM(this.text.substring(n))),t.push("")),this.domNode.innerHTML=t.join(""),this.didEverRender=!0},e.prototype.dispose=function(){this.text=null,this.highlights=null},e}(),mM=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vM=function(){function e(e){this._element=e}return Object.defineProperty(e.prototype,"element",{get:function(){return this._element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textContent",{set:function(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{set:function(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{set:function(e){this.disposed||e===this._title||(this._title=e,this._title?this._element.title=e:this._element.removeAttribute("title"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"empty",{set:function(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":null)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.disposed=!0},e}(),yM=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.setFile(n,r,i),o}return mM(t,e),t.prototype.setFile=function(e,t,n){var r=$n(e.fsPath);this.setValue(LE(e),r&&"."!==r?IE(r,t,n):"",{title:e.fsPath})},t}(function(){function e(e,t){var n=this;this.domNode=new vM(vh(e,bh(".monaco-icon-label"))),this.labelDescriptionContainer=new vM(vh(this.domNode.element,bh(".monaco-icon-label-description-container"))),t&&t.supportHighlights?this.labelNode=new gM(vh(this.labelDescriptionContainer.element,bh("a.label-name"))):this.labelNode=new vM(vh(this.labelDescriptionContainer.element,bh("a.label-name"))),t&&t.supportDescriptionHighlights?this.descriptionNodeFactory=function(){return new gM(vh(n.labelDescriptionContainer.element,bh("span.label-description")))}:this.descriptionNodeFactory=function(){return new vM(vh(n.labelDescriptionContainer.element,bh("span.label-description")))}}return Object.defineProperty(e.prototype,"element",{get:function(){return this.domNode.element},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){return sn([kc(this.labelDescriptionContainer.element,ph.CLICK,function(t){return e(t)})])},e.prototype.setValue=function(e,t,n){var r=["monaco-icon-label"];n&&(n.extraClasses&&r.push.apply(r,n.extraClasses),n.italic&&r.push("italic")),this.domNode.className=r.join(" "),this.domNode.title=n&&n.title?n.title:"",this.labelNode instanceof gM?this.labelNode.set(e||"",n?n.matches:void 0):this.labelNode.textContent=e||"",(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof gM?(this.descriptionNode.set(t||"",n?n.descriptionMatches:void 0),n&&n.descriptionTitle?this.descriptionNode.element.title=n.descriptionTitle:this.descriptionNode.element.removeAttribute("title")):(this.descriptionNode.textContent=t||"",this.descriptionNode.title=n&&n.descriptionTitle?n.descriptionTitle:"",this.descriptionNode.empty=!t))},e.prototype.dispose=function(){this.domNode.dispose(),this.labelNode.dispose(),this.descriptionNode&&this.descriptionNode.dispose()},e}()),bM=function(){function e(e,t){this._parent=e,this._range=t,this._onRefChanged=new wn,this.onRefChanged=this._onRefChanged.event,this._id=xw.nextId()}return Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uri",{get:function(){return this._parent.uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._parent.name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"directory",{get:function(){return this._parent.directory},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"range",{get:function(){return this._range},set:function(e){this._range=e,this._onRefChanged.fire(this)},enumerable:!0,configurable:!0}),e.prototype.getAriaMessage=function(){return ns("aria.oneReference","symbol in {0} on line {1} at column {2}",er(this.uri.fsPath),this.range.startLineNumber,this.range.startColumn)},e}(),_M=function(){function e(e){this._modelReference=e}return Object.defineProperty(e.prototype,"_model",{get:function(){return this._modelReference.object.textEditorModel},enumerable:!0,configurable:!0}),e.prototype.preview=function(e,t){void 0===t&&(t=8);var n=this._model;if(n){var r=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,s=e.endColumn,a=n.getWordUntilPosition({lineNumber:r,column:i-t}),u=new be(r,a.startColumn,r,i),l=new be(o,s,o,Number.MAX_VALUE);return{before:n.getValueInRange(u).replace(/^\s+/,qe),inside:n.getValueInRange(e),after:n.getValueInRange(l).replace(/\s+$/,qe)}}},e.prototype.dispose=function(){this._modelReference&&(this._modelReference.dispose(),this._modelReference=null)},e}(),CM=function(){function e(e,t){this._parent=e,this._uri=t,this._children=[]}return Object.defineProperty(e.prototype,"id",{get:function(){return this._uri.toString()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._children},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return er(this.uri.fsPath)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"directory",{get:function(){return $n(this.uri.fsPath)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preview",{get:function(){return this._preview},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"failure",{get:function(){return this._loadFailure},enumerable:!0,configurable:!0}),e.prototype.getAriaMessage=function(){var e=this.children.length;return 1===e?ns("aria.fileReferences.1","1 symbol in {0}, full path {1}",er(this.uri.fsPath),this.uri.fsPath):ns("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,er(this.uri.fsPath),this.uri.fsPath)},e.prototype.resolve=function(e){var t=this;return this._resolved?cn.b.as(this):e.createModelReference(this._uri).then(function(e){if(!e.object)throw e.dispose(),new Error;return t._preview=new _M(e),t._resolved=!0,t},function(e){return t._children=[],t._resolved=!0,t._loadFailure=e,t})},e.prototype.dispose=function(){this._preview&&(this._preview.dispose(),this._preview=null)},e}(),wM=function(){function e(t){var n,r=this;this._groups=[],this._references=[],this._onDidChangeReferenceRange=new wn,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._disposables=[],t.sort(e._compareReferences);for(var i=0,o=t;i0?(r=t?(r+1)%i:(r+i-1)%i,n.children[r]):(r=n.parent.groups.indexOf(n),t?(r=(r+1)%o,n.parent.groups[r].children[0]):(r=(r+o-1)%o,n.parent.groups[r].children[n.parent.groups[r].children.length-1]))},e.prototype.nearestReference=function(e,t){var n=this._references.map(function(n,r){return{idx:r,prefixLen:It(n.uri.toString(),e.toString()),offsetDist:100*Math.abs(n.range.startLineNumber-t.lineNumber)+Math.abs(n.range.startColumn-t.column)}}).sort(function(e,t){return e.prefixLen>t.prefixLen?-1:e.prefixLent.offsetDist?1:0})[0];if(n)return this._references[n.idx]},e.prototype.dispose=function(){this._groups=on(this._groups),on(this._disposables),this._disposables.length=0},e._compareReferences=function(e,t){var n=e.uri.toString(),r=t.uri.toString();return nr?1:be.compareRangesUsingStarts(e.range,t.range)},e}(),DM=Or("textModelService");function EM(e,t){var n=Object.create(null);for(var r in t){var i=t[r];"string"==typeof i?n[r]=e.getColor(i):"function"==typeof i&&(n[r]=i(e))}return n}function AM(e,t,n){function r(r){var i=EM(e.getTheme(),t);"function"==typeof n?n(i):n.style(i)}return r(e.getTheme()),e.onThemeChange(r)}function SM(e,t,n){return AM(t,ds(n||Object.create(null),xM,!1),e)}var xM={listFocusBackground:Lf,listFocusForeground:kf,listActiveSelectionBackground:Ig(Tf,.1),listActiveSelectionForeground:Ff,listFocusAndSelectionBackground:Tf,listFocusAndSelectionForeground:Ff,listInactiveSelectionBackground:Of,listInactiveSelectionForeground:Pf,listInactiveFocusBackground:Bf,listHoverBackground:Rf,listHoverForeground:jf,listDropBackground:zf,listFocusOutline:mf,listSelectionOutline:mf,listHoverOutline:mf};var MM,NM,IM=Or("environmentService"),LM=function(){function e(e,t){this.renderer=e,this.modelProvider=t}return Object.defineProperty(e.prototype,"templateId",{get:function(){return this.renderer.templateId},enumerable:!0,configurable:!0}),e.prototype.renderTemplate=function(e){return{data:this.renderer.renderTemplate(e),disposable:{dispose:function(){}}}},e.prototype.renderElement=function(e,t,n){var r=this;n.disposable.dispose();var i=this.modelProvider();if(i.isResolved(e))return this.renderer.renderElement(i.get(e),e,n.data);var o=i.resolve(e);n.disposable={dispose:function(){return o.cancel()}},this.renderer.renderPlaceholder(e,n.data),o.done(function(t){return r.renderer.renderElement(t,e,n.data)})},e.prototype.disposeTemplate=function(e){e.disposable.dispose(),e.disposable=null,this.renderer.disposeTemplate(e.data),e.data=null},e}(),kM=function(){function e(e,t,n,r){void 0===r&&(r={});var i=this,o=n.map(function(e){return new LM(e,function(){return i.model})});this.list=new xC(e,t,o,r)}return e.prototype.getHTMLElement=function(){return this.list.getHTMLElement()},e.prototype.isDOMFocused=function(){return this.list.getHTMLElement()===document.activeElement},e.prototype.domFocus=function(){this.list.domFocus()},Object.defineProperty(e.prototype,"onDidFocus",{get:function(){return this.list.onDidFocus},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidBlur",{get:function(){return this.list.onDidBlur},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widget",{get:function(){return this.list},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidDispose",{get:function(){return this.list.onDidDispose},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onFocusChange",{get:function(){var e=this;return xn(this.list.onFocusChange,function(t){var n=t.elements,r=t.indexes;return{elements:n.map(function(t){return e._model.get(t)}),indexes:r}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onOpen",{get:function(){var e=this;return xn(this.list.onOpen,function(t){var n=t.elements,r=t.indexes,i=t.browserEvent;return{elements:n.map(function(t){return e._model.get(t)}),indexes:r,browserEvent:i}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){var e=this;return xn(this.list.onSelectionChange,function(t){var n=t.elements,r=t.indexes;return{elements:n.map(function(t){return e._model.get(t)}),indexes:r}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onPin",{get:function(){var e=this;return xn(this.list.onPin,function(t){var n=t.elements,r=t.indexes;return{elements:n.map(function(t){return e._model.get(t)}),indexes:r}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.list.splice(0,this.list.length,Qn(e.length))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.list.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollTop",{get:function(){return this.list.scrollTop},set:function(e){this.list.scrollTop=e},enumerable:!0,configurable:!0}),e.prototype.open=function(e,t){this.list.open(e,t)},e.prototype.setFocus=function(e){this.list.setFocus(e)},e.prototype.focusNext=function(e,t){this.list.focusNext(e,t)},e.prototype.focusPrevious=function(e,t){this.list.focusPrevious(e,t)},e.prototype.selectNext=function(e,t){this.list.selectNext(e,t)},e.prototype.selectPrevious=function(e,t){this.list.selectPrevious(e,t)},e.prototype.focusNextPage=function(){this.list.focusNextPage()},e.prototype.focusPreviousPage=function(){this.list.focusPreviousPage()},e.prototype.getFocus=function(){return this.list.getFocus()},e.prototype.setSelection=function(e){this.list.setSelection(e)},e.prototype.getSelection=function(){return this.list.getSelection()},e.prototype.layout=function(e){this.list.layout(e)},e.prototype.reveal=function(e,t){this.list.reveal(e,t)},e.prototype.style=function(e){this.list.style(e)},e.prototype.dispose=function(){this.list.dispose()},e}(),TM=(n(358),function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}());!function(e){e[e.ON_MOUSE_DOWN=0]="ON_MOUSE_DOWN",e[e.ON_MOUSE_UP=1]="ON_MOUSE_UP"}(MM||(MM={})),function(e){e[e.SINGLE_CLICK=0]="SINGLE_CLICK",e[e.DOUBLE_CLICK=1]="DOUBLE_CLICK"}(NM||(NM={}));var FM=function(){function e(){this._arr=[]}return e.prototype.set=function(e,t){this._arr.push({keybinding:$a(e,we.a),callback:t})},e.prototype.dispatch=function(e){for(var t=this._arr.length-1;t>=0;t--){var n=this._arr[t];if(e.equals(n.keybinding))return n.callback}return null},e}(),OM=function(){function e(e){void 0===e&&(e={clickBehavior:MM.ON_MOUSE_DOWN,keyboardSupport:!0,openMode:NM.SINGLE_CLICK});var t=this;this.options=e,this.downKeyBindingDispatcher=new FM,this.upKeyBindingDispatcher=new FM,("boolean"!=typeof e.keyboardSupport||e.keyboardSupport)&&(this.downKeyBindingDispatcher.set(16,function(e,n){return t.onUp(e,n)}),this.downKeyBindingDispatcher.set(18,function(e,n){return t.onDown(e,n)}),this.downKeyBindingDispatcher.set(15,function(e,n){return t.onLeft(e,n)}),this.downKeyBindingDispatcher.set(17,function(e,n){return t.onRight(e,n)}),we.d&&(this.downKeyBindingDispatcher.set(2064,function(e,n){return t.onLeft(e,n)}),this.downKeyBindingDispatcher.set(300,function(e,n){return t.onDown(e,n)}),this.downKeyBindingDispatcher.set(302,function(e,n){return t.onUp(e,n)})),this.downKeyBindingDispatcher.set(11,function(e,n){return t.onPageUp(e,n)}),this.downKeyBindingDispatcher.set(12,function(e,n){return t.onPageDown(e,n)}),this.downKeyBindingDispatcher.set(14,function(e,n){return t.onHome(e,n)}),this.downKeyBindingDispatcher.set(13,function(e,n){return t.onEnd(e,n)}),this.downKeyBindingDispatcher.set(10,function(e,n){return t.onSpace(e,n)}),this.downKeyBindingDispatcher.set(9,function(e,n){return t.onEscape(e,n)}),this.upKeyBindingDispatcher.set(3,this.onEnter.bind(this)),this.upKeyBindingDispatcher.set(2051,this.onEnter.bind(this)))}return e.prototype.onMouseDown=function(e,t,n,r){if(void 0===r&&(r="mouse"),this.options.clickBehavior===MM.ON_MOUSE_DOWN&&(n.leftButton||n.middleButton)){if(n.target){if(n.target.tagName&&"input"===n.target.tagName.toLowerCase())return!1;if(ah(n.target,"monaco-action-bar","row"))return!1}return this.onLeftClick(e,t,n,r)}return!1},e.prototype.onClick=function(e,t,n){return we.d&&n.ctrlKey?(n.preventDefault(),n.stopPropagation(),!1):(!n.target||!n.target.tagName||"input"!==n.target.tagName.toLowerCase())&&((this.options.clickBehavior!==MM.ON_MOUSE_DOWN||!n.leftButton&&!n.middleButton)&&this.onLeftClick(e,t,n))},e.prototype.onLeftClick=function(e,t,n,r){void 0===r&&(r="mouse");var i={origin:r,originalEvent:n},o=n,s="mouse"===r&&2===o.detail;e.getInput()===t?(e.clearFocus(i),e.clearSelection(i)):(n&&o.browserEvent&&"mousedown"===o.browserEvent.type||n.preventDefault(),n.stopPropagation(),e.domFocus(),e.setSelection([t],i),e.setFocus(t,i),(this.openOnSingleClick||s||this.isClickOnTwistie(o))&&(e.isExpanded(t)?e.collapse(t).done(null,pn):e.expand(t).done(null,pn)));return!0},e.prototype.setOpenMode=function(e){this.options.openMode=e},Object.defineProperty(e.prototype,"openOnSingleClick",{get:function(){return this.options.openMode===NM.SINGLE_CLICK},enumerable:!0,configurable:!0}),e.prototype.isClickOnTwistie=function(e){var t=e.target;return t&&"content"===t.className&&xc(t.parentElement,"monaco-tree-row")},e.prototype.onContextMenu=function(e,t,n){return(!n.target||!n.target.tagName||"input"!==n.target.tagName.toLowerCase())&&(n&&(n.preventDefault(),n.stopPropagation()),!1)},e.prototype.onTap=function(e,t,n){var r=n.initialTarget;return(!r||!r.tagName||"input"!==r.tagName.toLowerCase())&&this.onLeftClick(e,t,n,"touch")},e.prototype.onKeyDown=function(e,t){return this.onKey(this.downKeyBindingDispatcher,e,t)},e.prototype.onKeyUp=function(e,t){return this.onKey(this.upKeyBindingDispatcher,e,t)},e.prototype.onKey=function(e,t,n){var r=e.dispatch(n.toKeybinding());return!(!r||!r(t,n))&&(n.preventDefault(),n.stopPropagation(),!0)},e.prototype.onUp=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusPrevious(1,n),e.reveal(e.getFocus()).done(null,pn)),!0},e.prototype.onPageUp=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusPreviousPage(n),e.reveal(e.getFocus()).done(null,pn)),!0},e.prototype.onDown=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusNext(1,n),e.reveal(e.getFocus()).done(null,pn)),!0},e.prototype.onPageDown=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusNextPage(n),e.reveal(e.getFocus()).done(null,pn)),!0},e.prototype.onHome=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusFirst(n),e.reveal(e.getFocus()).done(null,pn)),!0},e.prototype.onEnd=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?e.clearHighlight(n):(e.focusLast(n),e.reveal(e.getFocus()).done(null,pn)),!0},e.prototype.onLeft=function(e,t){var n={origin:"keyboard",originalEvent:t};if(e.getHighlight())e.clearHighlight(n);else{var r=e.getFocus();e.collapse(r).then(function(t){if(r&&!t)return e.focusParent(n),e.reveal(e.getFocus())}).done(null,pn)}return!0},e.prototype.onRight=function(e,t){var n={origin:"keyboard",originalEvent:t};if(e.getHighlight())e.clearHighlight(n);else{var r=e.getFocus();e.expand(r).then(function(t){if(r&&!t)return e.focusFirstChild(n),e.reveal(e.getFocus())}).done(null,pn)}return!0},e.prototype.onEnter=function(e,t){var n={origin:"keyboard",originalEvent:t};if(e.getHighlight())return!1;var r=e.getFocus();return r&&e.setSelection([r],n),!0},e.prototype.onSpace=function(e,t){if(e.getHighlight())return!1;var n=e.getFocus();return n&&e.toggleExpansion(n),!0},e.prototype.onEscape=function(e,t){var n={origin:"keyboard",originalEvent:t};return e.getHighlight()?(e.clearHighlight(n),!0):e.getSelection().length?(e.clearSelection(n),!0):!!e.getFocus()&&(e.clearFocus(n),!0)},e}(),PM=function(){function e(){}return e.prototype.getDragURI=function(e,t){return null},e.prototype.onDragStart=function(e,t,n){},e.prototype.onDragOver=function(e,t,n,r){return null},e.prototype.drop=function(e,t,n,r){},e}(),BM=function(){function e(){}return e.prototype.isVisible=function(e,t){return!0},e}(),RM=(function(){function e(){}e.prototype.compare=function(e,t,n){return 0}}(),function(){function e(){}return e.prototype.getAriaLabel=function(e,t){return null},e}()),jM=function(){function e(e,t){this.styleElement=e,this.selectorSuffix=t}return e.prototype.style=function(e){var t=this.selectorSuffix?"."+this.selectorSuffix:"",n=[];e.listFocusBackground&&n.push(".monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) { background-color: "+e.listFocusBackground+"; }"),e.listFocusForeground&&n.push(".monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) { color: "+e.listFocusForeground+"; }"),e.listActiveSelectionBackground&&n.push(".monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: "+e.listActiveSelectionBackground+"; }"),e.listActiveSelectionForeground&&n.push(".monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: "+e.listActiveSelectionForeground+"; }"),e.listFocusAndSelectionBackground&&n.push("\n\t\t\t\t.monaco-tree-drag-image,\n\t\t\t\t.monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.focused.selected:not(.highlighted) { background-color: "+e.listFocusAndSelectionBackground+"; }\n\t\t\t"),e.listFocusAndSelectionForeground&&n.push("\n\t\t\t\t.monaco-tree-drag-image,\n\t\t\t\t.monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.focused.selected:not(.highlighted) { color: "+e.listFocusAndSelectionForeground+"; }\n\t\t\t"),e.listInactiveSelectionBackground&&n.push(".monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: "+e.listInactiveSelectionBackground+"; }"),e.listInactiveSelectionForeground&&n.push(".monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: "+e.listInactiveSelectionForeground+"; }"),e.listHoverBackground&&n.push(".monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { background-color: "+e.listHoverBackground+"; }"),e.listHoverForeground&&n.push(".monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) { color: "+e.listHoverForeground+"; }"),e.listDropBackground&&n.push("\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-wrapper.drop-target,\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row.drop-target { background-color: "+e.listDropBackground+" !important; color: inherit !important; }\n\t\t\t"),e.listFocusOutline&&n.push("\n\t\t\t\t.monaco-tree-drag-image\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ border: 1px solid "+e.listFocusOutline+"; background: #000; }\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row \t\t\t\t\t\t\t\t\t\t\t\t\t\t{ border: 1px solid transparent; }\n\t\t\t\t.monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.focused:not(.highlighted) \t\t\t\t\t\t{ border: 1px dotted "+e.listFocusOutline+"; }\n\t\t\t\t.monaco-tree"+t+".focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) \t\t\t\t\t\t{ border: 1px solid "+e.listFocusOutline+"; }\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) \t\t\t\t\t\t\t{ border: 1px solid "+e.listFocusOutline+"; }\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row:hover:not(.highlighted):not(.selected):not(.focused) \t{ border: 1px dashed "+e.listFocusOutline+"; }\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-wrapper.drop-target,\n\t\t\t\t.monaco-tree"+t+" .monaco-tree-rows > .monaco-tree-row.drop-target\t\t\t\t\t\t\t\t\t\t\t\t{ border: 1px dashed "+e.listFocusOutline+"; }\n\t\t\t");var r=n.join("\n");r!==this.styleElement.innerHTML&&(this.styleElement.innerHTML=r)},e}(),zM=(function(e){function t(t,n){var r=e.call(this,"vs.tree.collapse",ns("collapse","Collapse"),"monaco-tree-action collapse-all",n)||this;return r.viewer=t,r}TM(t,e),t.prototype.run=function(e){return this.viewer.getHighlight()?cn.b.as(null):(this.viewer.collapseAll(),this.viewer.clearSelection(),this.viewer.clearFocus(),this.viewer.domFocus(),this.viewer.focusFirst(),cn.b.as(null))}}(hu),function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),WM=function(){function e(e){this._onDispose=new wn,this.onDispose=this._onDispose.event,this._item=e}return Object.defineProperty(e.prototype,"item",{get:function(){return this._item},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._onDispose&&(this._onDispose.fire(),this._onDispose.dispose(),this._onDispose=null)},e}(),VM=function(){function e(){this.locks=Object.create({})}return e.prototype.isLocked=function(e){return!!this.locks[e.id]},e.prototype.run=function(e,t){var n,r,i=this,o=this.getLock(e);return o?new cn.b(function(r,s){n=En(o.onDispose)(function(){return i.run(e,t).then(r,s)})},function(){n.dispose()}):new cn.b(function(n,o){if(e.isDisposed())return o(new Error("Item is disposed."));var s=i.locks[e.id]=new WM(e);return r=t().then(function(t){return delete i.locks[e.id],s.dispose(),t}).then(n,o)},function(){return r.cancel()})},e.prototype.getLock=function(e){var t;for(t in this.locks){var n=this.locks[t];if(e.intersects(n.item))return n}return null},e}(),HM=function(){function e(){this._isDisposed=!1,this._onDidRevealItem=new Dn,this.onDidRevealItem=this._onDidRevealItem.event,this._onExpandItem=new Dn,this.onExpandItem=this._onExpandItem.event,this._onDidExpandItem=new Dn,this.onDidExpandItem=this._onDidExpandItem.event,this._onCollapseItem=new Dn,this.onCollapseItem=this._onCollapseItem.event,this._onDidCollapseItem=new Dn,this.onDidCollapseItem=this._onDidCollapseItem.event,this._onDidAddTraitItem=new Dn,this.onDidAddTraitItem=this._onDidAddTraitItem.event,this._onDidRemoveTraitItem=new Dn,this.onDidRemoveTraitItem=this._onDidRemoveTraitItem.event,this._onDidRefreshItem=new Dn,this.onDidRefreshItem=this._onDidRefreshItem.event,this._onRefreshItemChildren=new Dn,this.onRefreshItemChildren=this._onRefreshItemChildren.event,this._onDidRefreshItemChildren=new Dn,this.onDidRefreshItemChildren=this._onDidRefreshItemChildren.event,this._onDidDisposeItem=new Dn,this.onDidDisposeItem=this._onDidDisposeItem.event,this.items={}}return e.prototype.register=function(e){ou(!this.isRegistered(e.id),"item already registered: "+e.id);var t=sn([this._onDidRevealItem.add(e.onDidReveal),this._onExpandItem.add(e.onExpand),this._onDidExpandItem.add(e.onDidExpand),this._onCollapseItem.add(e.onCollapse),this._onDidCollapseItem.add(e.onDidCollapse),this._onDidAddTraitItem.add(e.onDidAddTrait),this._onDidRemoveTraitItem.add(e.onDidRemoveTrait),this._onDidRefreshItem.add(e.onDidRefresh),this._onRefreshItemChildren.add(e.onRefreshChildren),this._onDidRefreshItemChildren.add(e.onDidRefreshChildren),this._onDidDisposeItem.add(e.onDidDispose)]);this.items[e.id]={item:e,disposable:t}},e.prototype.deregister=function(e){ou(this.isRegistered(e.id),"item not registered: "+e.id),this.items[e.id].disposable.dispose(),delete this.items[e.id]},e.prototype.isRegistered=function(e){return this.items.hasOwnProperty(e)},e.prototype.getItem=function(e){var t=this.items[e];return t?t.item:null},e.prototype.dispose=function(){this.items=null,this._onDidRevealItem.dispose(),this._onExpandItem.dispose(),this._onDidExpandItem.dispose(),this._onCollapseItem.dispose(),this._onDidCollapseItem.dispose(),this._onDidAddTraitItem.dispose(),this._onDidRemoveTraitItem.dispose(),this._onDidRefreshItem.dispose(),this._onRefreshItemChildren.dispose(),this._onDidRefreshItemChildren.dispose(),this._isDisposed=!0},e.prototype.isDisposed=function(){return this._isDisposed},e}(),UM=function(){function e(e,t,n,r,i){this._onDidCreate=new wn,this.onDidCreate=this._onDidCreate.event,this._onDidReveal=new wn,this.onDidReveal=this._onDidReveal.event,this._onExpand=new wn,this.onExpand=this._onExpand.event,this._onDidExpand=new wn,this.onDidExpand=this._onDidExpand.event,this._onCollapse=new wn,this.onCollapse=this._onCollapse.event,this._onDidCollapse=new wn,this.onDidCollapse=this._onDidCollapse.event,this._onDidAddTrait=new wn,this.onDidAddTrait=this._onDidAddTrait.event,this._onDidRemoveTrait=new wn,this.onDidRemoveTrait=this._onDidRemoveTrait.event,this._onDidRefresh=new wn,this.onDidRefresh=this._onDidRefresh.event,this._onRefreshChildren=new wn,this.onRefreshChildren=this._onRefreshChildren.event,this._onDidRefreshChildren=new wn,this.onDidRefreshChildren=this._onDidRefreshChildren.event,this._onDidDispose=new wn,this.onDidDispose=this._onDidDispose.event,this.registry=t,this.context=n,this.lock=r,this.element=i,this.id=e,this.registry.register(this),this.doesHaveChildren=this.context.dataSource.hasChildren(this.context.tree,this.element),this.needsChildrenRefresh=!0,this.parent=null,this.previous=null,this.next=null,this.firstChild=null,this.lastChild=null,this.traits={},this.depth=0,this.expanded=this.context.dataSource.shouldAutoexpand&&this.context.dataSource.shouldAutoexpand(this.context.tree,i),this._onDidCreate.fire(this),this.visible=this._isVisible(),this.height=this._getHeight(),this._isDisposed=!1}return e.prototype.getElement=function(){return this.element},e.prototype.hasChildren=function(){return this.doesHaveChildren},e.prototype.getDepth=function(){return this.depth},e.prototype.isVisible=function(){return this.visible},e.prototype.setVisible=function(e){this.visible=e},e.prototype.isExpanded=function(){return this.expanded},e.prototype._setExpanded=function(e){this.expanded=e},e.prototype.reveal=function(e){void 0===e&&(e=null);var t={item:this,relativeTop:e};this._onDidReveal.fire(t)},e.prototype.expand=function(){var e=this;return this.isExpanded()||!this.doesHaveChildren||this.lock.isLocked(this)?cn.b.as(!1):this.lock.run(this,function(){var t={item:e};return e._onExpand.fire(t),(e.needsChildrenRefresh?e.refreshChildren(!1,!0,!0):cn.b.as(null)).then(function(){return e._setExpanded(!0),e._onDidExpand.fire(t),!0})}).then(function(t){return!e.isDisposed()&&(e.context.options.autoExpandSingleChildren&&t&&null!==e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.isVisible()?e.firstChild.expand().then(function(){return!0}):t)})},e.prototype.collapse=function(e){var t=this;if(void 0===e&&(e=!1),e){var n=cn.b.as(null);return this.forEachChild(function(e){n=n.then(function(){return e.collapse(!0)})}),n.then(function(){return t.collapse(!1)})}return!this.isExpanded()||this.lock.isLocked(this)?cn.b.as(!1):this.lock.run(this,function(){var e={item:t};return t._onCollapse.fire(e),t._setExpanded(!1),t._onDidCollapse.fire(e),cn.b.as(!0)})},e.prototype.addTrait=function(e){var t={item:this,trait:e};this.traits[e]=!0,this._onDidAddTrait.fire(t)},e.prototype.removeTrait=function(e){var t={item:this,trait:e};delete this.traits[e],this._onDidRemoveTrait.fire(t)},e.prototype.hasTrait=function(e){return this.traits[e]||!1},e.prototype.getAllTraits=function(){var e,t=[];for(e in this.traits)this.traits.hasOwnProperty(e)&&this.traits[e]&&t.push(e);return t},e.prototype.getHeight=function(){return this.height},e.prototype.refreshChildren=function(t,n,r){var i=this;if(void 0===n&&(n=!1),void 0===r&&(r=!1),!r&&!this.isExpanded())return this.needsChildrenRefresh=!0,cn.b.as(this);this.needsChildrenRefresh=!1;var o=function(){var r={item:i,isNested:n};return i._onRefreshChildren.fire(r),(i.doesHaveChildren?i.context.dataSource.getChildren(i.context.tree,i.element):cn.b.as([])).then(function(n){if(i.isDisposed()||i.registry.isDisposed())return cn.b.as(null);if(!Array.isArray(n))return cn.b.wrapError(new Error("Please return an array of children."));n=n?n.slice(0):[],n=i.sort(n);for(var r={};null!==i.firstChild;)r[i.firstChild.id]=i.firstChild,i.removeChild(i.firstChild);for(var o=0,s=n.length;o0?i[0]:this.input,s=this.getNavigator(o,!1),a=0;a0?n[0]:this.input,i=this.getNavigator(r,!1).parent();i&&(t?this.setSelection([i],e):this.select(i,e))},e.prototype.setFocus=function(e,t){this.setTraits("focused",e?[e]:[]);var n={focus:this.getFocus(),payload:t};this._onDidFocus.fire(n)},e.prototype.isFocused=function(e){var t=this.getItem(e);return!!t&&t.hasTrait("focused")},e.prototype.getFocus=function(e){var t=this.getElementsWithTrait("focused",e);return 0===t.length?null:t[0]},e.prototype.focusNext=function(e,t){void 0===e&&(e=1);for(var n,r=this.getFocus()||this.input,i=this.getNavigator(r,!1),o=0;o0||this.m_modifiedCount>0)&&this.m_changes.push(new qM(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Number.MAX_VALUE,this.m_modifiedStart=Number.MAX_VALUE},e.prototype.AddOriginalElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++},e.prototype.AddModifiedElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++},e.prototype.getChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes},e.prototype.getReverseChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes},e}(),rN=Object.prototype.hasOwnProperty,iN=function(){function e(e,t,n){void 0===n&&(n=null),this.OriginalSequence=e,this.ModifiedSequence=t,this.ContinueProcessingPredicate=n,this.m_originalIds=[],this.m_modifiedIds=[],this.m_forwardHistory=[],this.m_reverseHistory=[],this.ComputeUniqueIdentifiers()}return e.prototype.ComputeUniqueIdentifiers=function(){var e=this.OriginalSequence.getLength(),t=this.ModifiedSequence.getLength();this.m_originalIds=new Array(e),this.m_modifiedIds=new Array(t);var n,r={},i=1;for(n=0;n=e&&r>=n&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||n>r){var o=void 0;return n<=r?(eN.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new qM(e,0,n,r-n+1)]):e<=t?(eN.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[new qM(e,t-e+1,n,0)]):(eN.Assert(e===t+1,"originalStart should only be one more than originalEnd"),eN.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}var s=[0],a=[0],u=this.ComputeRecursionPoint(e,t,n,r,s,a,i),l=s[0],c=a[0];if(null!==u)return u;if(!i[0]){var h=this.ComputeDiffRecursive(e,l,n,c,i),d=[];return d=i[0]?[new qM(l+1,t-(l+1)+1,c+1,r-(c+1)+1)]:this.ComputeDiffRecursive(l+1,t,c+1,r,i),this.ConcatenateChanges(h,d)}return[new qM(e,t-e+1,n,r-n+1)]},e.prototype.WALKTRACE=function(e,t,n,r,i,o,s,a,u,l,c,h,d,p,f,g,m,v){var y,b,_=null,C=new nN,w=t,D=n,E=d[0]-g[0]-r,A=Number.MIN_VALUE,S=this.m_forwardHistory.length-1;do{(b=E+e)===w||b=0&&(e=(u=this.m_forwardHistory[S])[0],w=1,D=u.length-1)}while(--S>=-1);if(y=C.getReverseChanges(),v[0]){var x=d[0]+1,M=g[0]+1;if(null!==y&&y.length>0){var N=y[y.length-1];x=Math.max(x,N.getOriginalEnd()),M=Math.max(M,N.getModifiedEnd())}_=[new qM(x,h-x+1,M,f-M+1)]}else{C=new nN,w=o,D=s,E=d[0]-g[0]-a,A=Number.MAX_VALUE,S=m?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{(b=E+i)===w||b=l[b+1]?(p=(c=l[b+1]-1)-E-a,c>A&&C.MarkNextChange(),A=c+1,C.AddOriginalElement(c+1,p+1),E=b+1-i):(p=(c=l[b-1])-E-a,c>A&&C.MarkNextChange(),A=c,C.AddModifiedElement(c+1,p+1),E=b-1-i),S>=0&&(i=(l=this.m_reverseHistory[S])[0],w=1,D=l.length-1)}while(--S>=-1);_=C.getChanges()}return this.ConcatenateChanges(y,_)},e.prototype.ComputeRecursionPoint=function(e,t,n,r,i,o,s){var a,u,l,c=0,h=0,d=0,p=0;e--,n--,i[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];var f,g,m=t-e+(r-n),v=m+1,y=new Array(v),b=new Array(v),_=r-n,C=t-e,w=e-n,D=t-r,E=(C-_)%2==0;for(y[_]=e,b[C]=t,s[0]=!1,l=1;l<=m/2+1;l++){var A=0,S=0;for(c=this.ClipDiagonalBound(_-l,l,_,v),h=this.ClipDiagonalBound(_+l,l,_,v),f=c;f<=h;f+=2){for(u=(a=f===c||fA+S&&(A=a,S=u),!E&&Math.abs(f-C)<=l-1&&a>=b[f])return i[0]=a,o[0]=u,g<=b[f]&&l<=1448?this.WALKTRACE(_,c,h,w,C,d,p,D,y,b,a,t,i,u,r,o,E,s):null}var x=(A-e+(S-n)-l)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(A,this.OriginalSequence,x))return s[0]=!0,i[0]=A,o[0]=S,x>0&&l<=1448?this.WALKTRACE(_,c,h,w,C,d,p,D,y,b,a,t,i,u,r,o,E,s):[new qM(++e,t-e+1,++n,r-n+1)];for(d=this.ClipDiagonalBound(C-l,l,C,v),p=this.ClipDiagonalBound(C+l,l,C,v),f=d;f<=p;f+=2){for(u=(a=f===d||f=b[f+1]?b[f+1]-1:b[f-1])-(f-C)-D,g=a;a>e&&u>n&&this.ElementsAreEqual(a,u);)a--,u--;if(b[f]=a,E&&Math.abs(f-_)<=l&&a<=y[f])return i[0]=a,o[0]=u,g>=y[f]&&l<=1448?this.WALKTRACE(_,c,h,w,C,d,p,D,y,b,a,t,i,u,r,o,E,s):null}if(l<=1447){var M=new Array(h-c+2);M[0]=_-c+1,tN.Copy(y,c,M,1,h-c+1),this.m_forwardHistory.push(M),(M=new Array(p-d+2))[0]=C-d+1,tN.Copy(b,d,M,1,p-d+1),this.m_reverseHistory.push(M)}}return this.WALKTRACE(_,c,h,w,C,d,p,D,y,b,a,t,i,u,r,o,E,s)},e.prototype.ShiftChanges=function(e){var t;do{t=!1;for(var n=0;n0,a=r.modifiedLength>0;r.originalStart+r.originalLength=0;n--){r=e[n],i=0,o=0;if(n>0){var c=e[n-1];c.originalLength>0&&(i=c.originalStart+c.originalLength),c.modifiedLength>0&&(o=c.modifiedStart+c.modifiedLength)}s=r.originalLength>0,a=r.modifiedLength>0;for(var h=0,d=this._boundaryScore(r.originalStart,r.originalLength,r.modifiedStart,r.modifiedLength),p=1;;p++){var f=r.originalStart-p,g=r.modifiedStart-p;if(fd&&(d=m,h=p)}r.originalStart-=h,r.modifiedStart-=h}return e},e.prototype._OriginalIsBoundary=function(e){return e<=0||e>=this.OriginalSequence.getLength()-1||/^\s*$/.test(this.OriginalSequence.getElementHash(e))},e.prototype._OriginalRegionIsBoundary=function(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1},e.prototype._ModifiedIsBoundary=function(e){return e<=0||e>=this.ModifiedSequence.getLength()-1||/^\s*$/.test(this.ModifiedSequence.getElementHash(e))},e.prototype._ModifiedRegionIsBoundary=function(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1},e.prototype._boundaryScore=function(e,t,n,r){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(n,r)?1:0)},e.prototype.ConcatenateChanges=function(e,t){var n=[],r=null;return 0===e.length||0===t.length?t.length>0?t:e:this.ChangesOverlap(e[e.length-1],t[0],n)?(r=new Array(e.length+t.length-1),tN.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],tN.Copy(t,1,r,e.length,t.length-1),r):(r=new Array(e.length+t.length),tN.Copy(e,0,r,0,e.length),tN.Copy(t,0,r,e.length,t.length),r)},e.prototype.ChangesOverlap=function(e,t,n){if(eN.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),eN.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){var r=e.originalStart,i=e.originalLength,o=e.modifiedStart,s=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(i=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(s=t.modifiedStart+t.modifiedLength-e.modifiedStart),n[0]=new qM(r,i,o,s),!0}return n[0]=null,!1},e.prototype.ClipDiagonalBound=function(e,t,n,r){if(e>=0&&e=0;o--)this.onInsertItem(l[o]);for(o=this.heightMap.length-1;o>=i;o--)this.onRefreshItem(this.heightMap[o]);return a},e.prototype.onInsertItem=function(e){},e.prototype.onRemoveItems=function(e){for(var t,n,r,i=null,o=0;t=e.next();){if(r=this.indexes[t],!(n=this.heightMap[r]))return void console.error("view item doesnt exist");o-=n.height,delete this.indexes[t],this.onRemoveItem(n),null===i&&(i=r)}if(0!==o)for(this.heightMap.splice(i,r-i+1),r=i;r=n.top+n.height))return t;if(r===t)break;r=t}return this.heightMap.length},e.prototype.indexAfter=function(e){return Math.min(this.indexAt(e)+1,this.heightMap.length)},e.prototype.itemAtIndex=function(e){return this.heightMap[e]},e.prototype.itemAfter=function(e){return this.heightMap[this.indexes[e.model.id]+1]||null},e.prototype.createViewItem=function(e){throw new Error("not implemented")},e.prototype.dispose=function(){this.heightMap=null,this.indexes=null},e}(),lN=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cN=function(){function e(e,t,n){this._posx=e,this._posy=t,this._target=n}return e.prototype.preventDefault=function(){},e.prototype.stopPropagation=function(){},Object.defineProperty(e.prototype,"posx",{get:function(){return this._posx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"posy",{get:function(){return this._posy},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),e}(),hN=function(e){function t(t){var n=e.call(this,t.posx,t.posy,t.target)||this;return n.originalEvent=t,n}return lN(t,e),t.prototype.preventDefault=function(){this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.originalEvent.stopPropagation()},t}(cN),dN=function(e){function t(t,n,r){var i=e.call(this,t,n,r.target)||this;return i.originalEvent=r,i}return lN(t,e),t.prototype.preventDefault=function(){this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.originalEvent.stopPropagation()},t}(cN);!function(e){e[e.COPY=0]="COPY",e[e.MOVE=1]="MOVE"}(JM||(JM={})),function(e){e[e.BUBBLE_DOWN=0]="BUBBLE_DOWN",e[e.BUBBLE_UP=1]="BUBBLE_UP"}($M||($M={}));$M.BUBBLE_UP,$M.BUBBLE_UP,JM.COPY,function(){function e(e,t){var n=this;this.toDispose=[],this.toDispose.push(kc(e,"dragover",function(){n.timeout||(n.timeout=setTimeout(function(){t(),n.timeout=null},800))})),["dragleave","drop","dragend"].forEach(function(t){n.toDispose.push(kc(e,t,function(){n.clearDragTimeout()}))})}e.prototype.clearDragTimeout=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},e.prototype.dispose=function(){this.toDispose=on(this.toDispose),this.clearDragTimeout()}}();var pN="ResourceURLs",fN=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var gN=function(){function e(e){this.context=e,this._cache={"":[]}}return e.prototype.alloc=function(e){var t=this.cache(e).pop();if(!t){var n=document.createElement("div");n.className="content";var r=document.createElement("div");r.appendChild(n),t={element:r,templateId:e,templateData:this.context.renderer.renderTemplate(this.context.tree,e,n)}}return t},e.prototype.release=function(e,t){!function(e){try{e.parentElement.removeChild(e)}catch(e){}}(t.element),this.cache(e).push(t)},e.prototype.cache=function(e){return this._cache[e]||(this._cache[e]=[])},e.prototype.garbageCollect=function(){var e=this;this._cache&&Object.keys(this._cache).forEach(function(t){e._cache[t].forEach(function(n){e.context.renderer.disposeTemplate(e.context.tree,t,n.templateData),n.element=null,n.templateData=null}),delete e._cache[t]})},e.prototype.dispose=function(){this.garbageCollect(),this._cache=null,this.context=null},e}(),mN=function(){function e(e,t){var n=this;this.width=0,this.context=e,this.model=t,this.id=this.model.id,this.row=null,this.top=0,this.height=t.getHeight(),this._styles={},t.getAllTraits().forEach(function(e){return n._styles[e]=!0}),t.isExpanded()&&this.addClass("expanded")}return Object.defineProperty(e.prototype,"expanded",{set:function(e){e?this.addClass("expanded"):this.removeClass("expanded")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loading",{set:function(e){e?this.addClass("loading"):this.removeClass("loading")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"draggable",{get:function(){return this._draggable},set:function(e){this._draggable=e,this.render(!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dropTarget",{set:function(e){e?this.addClass("drop-target"):this.removeClass("drop-target")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.row&&this.row.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"templateId",{get:function(){return this._templateId||(this._templateId=this.context.renderer.getTemplateId&&this.context.renderer.getTemplateId(this.context.tree,this.model.getElement()))},enumerable:!0,configurable:!0}),e.prototype.addClass=function(e){this._styles[e]=!0,this.render(!0)},e.prototype.removeClass=function(e){delete this._styles[e],this.render(!0)},e.prototype.render=function(e){var t=this;if(void 0===e&&(e=!1),this.model&&this.element){var n=["monaco-tree-row"];n.push.apply(n,Object.keys(this._styles)),this.model.hasChildren()&&n.push("has-children"),this.element.className=n.join(" "),this.element.draggable=this.draggable,this.element.style.height=this.height+"px",this.element.setAttribute("role","treeitem");var r=this.context.accessibilityProvider,i=r.getAriaLabel(this.context.tree,this.model.getElement());if(i&&this.element.setAttribute("aria-label",i),r.getPosInSet&&r.getSetSize&&(this.element.setAttribute("aria-setsize",r.getSetSize()),this.element.setAttribute("aria-posinset",r.getPosInSet(this.context.tree,this.model.getElement()))),this.model.hasTrait("focused")){var o=Jt(this.model.id);this.element.setAttribute("aria-selected","true"),this.element.setAttribute("id",o)}else this.element.setAttribute("aria-selected","false"),this.element.removeAttribute("id");this.model.hasChildren()?this.element.setAttribute("aria-expanded",String(!!this.model.isExpanded())):this.element.removeAttribute("aria-expanded"),this.element.setAttribute("aria-level",String(this.model.getDepth())),this.context.options.paddingOnRow?this.element.style.paddingLeft=this.context.options.twistiePixels+(this.model.getDepth()-1)*this.context.options.indentPixels+"px":(this.element.style.paddingLeft=(this.model.getDepth()-1)*this.context.options.indentPixels+"px",this.row.element.firstElementChild.style.paddingLeft=this.context.options.twistiePixels+"px");var s=this.context.dnd.getDragURI(this.context.tree,this.model.getElement());if(s!==this.uri&&(this.unbindDragStart&&(this.unbindDragStart.dispose(),this.unbindDragStart=null),s?(this.uri=s,this.draggable=!0,this.unbindDragStart=kc(this.element,"dragstart",function(e){t.onDragStart(e)})):this.uri=null),!e&&this.element){var a=window.getComputedStyle(this.element),u=parseFloat(a.paddingLeft);this.context.horizontalScrolling&&(this.element.style.width="fit-content"),this.context.renderer.renderElement(this.context.tree,this.model.getElement(),this.templateId,this.row.templateData),this.context.horizontalScrolling&&(this.width=rh(this.element)+u,this.element.style.width="")}}},e.prototype.updateWidth=function(){if(this.context.horizontalScrolling&&this.element){var e=window.getComputedStyle(this.element),t=parseFloat(e.paddingLeft);this.element.style.width="fit-content",this.width=rh(this.element)+t,this.element.style.width=""}},e.prototype.insertInDOM=function(e,t){if(this.row||(this.row=this.context.cache.alloc(this.templateId),this.element[yN.BINDING]=this),!this.element.parentElement){if(null===t)e.appendChild(this.element);else try{e.insertBefore(this.element,t)}catch(t){console.warn("Failed to locate previous tree element"),e.appendChild(this.element)}this.render()}},e.prototype.removeFromDOM=function(){this.row&&(this.unbindDragStart&&(this.unbindDragStart.dispose(),this.unbindDragStart=null),this.uri=null,this.element[yN.BINDING]=null,this.context.cache.release(this.templateId,this.row),this.row=null)},e.prototype.dispose=function(){this.row=null,this.model=null},e}(),vN=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.row={element:r,templateData:null,templateId:null},i}return fN(t,e),t.prototype.render=function(){if(this.model&&this.element){var e=["monaco-tree-wrapper"];e.push.apply(e,Object.keys(this._styles)),this.model.hasChildren()&&e.push("has-children"),this.element.className=e.join(" ")}},t.prototype.insertInDOM=function(e,t){},t.prototype.removeFromDOM=function(){},t}(mN);var yN=function(e){function t(n,r){var i=e.call(this)||this;i.lastClickTimeStamp=0,i.contentWidthUpdateDelayer=new Rl(50),i.isRefreshing=!1,i.refreshingPreviousChildrenIds={},i._onDOMFocus=new wn,i._onDOMBlur=new wn,t.counter++,i.instance=t.counter;var o=void 0===n.options.horizontalScrollMode?rs.Hidden:n.options.horizontalScrollMode;i.horizontalScrolling=o!==rs.Hidden,i.context={dataSource:n.dataSource,renderer:n.renderer,controller:n.controller,dnd:n.dnd,filter:n.filter,sorter:n.sorter,tree:n.tree,accessibilityProvider:n.accessibilityProvider,options:n.options,cache:new gN(n),horizontalScrolling:i.horizontalScrolling},i.modelListeners=[],i.viewListeners=[],i.model=null,i.items={},i.domNode=document.createElement("div"),i.domNode.className="monaco-tree no-focused-item monaco-tree-instance-"+i.instance,i.domNode.tabIndex=n.options.preventRootFocus?-1:0,i.styleElement=uh(i.domNode),i.treeStyler=n.styler,i.treeStyler||(i.treeStyler=new jM(i.styleElement,"monaco-tree-instance-"+i.instance)),i.domNode.setAttribute("role","tree"),i.context.options.ariaLabel&&i.domNode.setAttribute("aria-label",i.context.options.ariaLabel),i.context.options.alwaysFocused&&Mc(i.domNode,"focused"),i.context.options.paddingOnRow||Mc(i.domNode,"no-row-padding"),i.wrapper=document.createElement("div"),i.wrapper.className="monaco-tree-wrapper",i.scrollableElement=new vb(i.wrapper,{alwaysConsumeMouseWheel:!0,horizontal:o,vertical:void 0!==n.options.verticalScrollMode?n.options.verticalScrollMode:rs.Auto,useShadows:n.options.useShadows}),i.scrollableElement.onScroll(function(e){i.render(e.scrollTop,e.height,e.scrollLeft,e.width,e.scrollWidth)}),Xl?(i.wrapper.style.msTouchAction="none",i.wrapper.style.msContentZooming="none"):Im.addTarget(i.wrapper),i.rowsContainer=document.createElement("div"),i.rowsContainer.className="monaco-tree-rows",n.options.showTwistie&&(i.rowsContainer.className+=" show-twisties");var s=mh(i.domNode);return i.viewListeners.push(s.onDidFocus(function(){return i.onFocus()})),i.viewListeners.push(s.onDidBlur(function(){return i.onBlur()})),i.viewListeners.push(s),i.viewListeners.push(kc(i.domNode,"keydown",function(e){return i.onKeyDown(e)})),i.viewListeners.push(kc(i.domNode,"keyup",function(e){return i.onKeyUp(e)})),i.viewListeners.push(kc(i.domNode,"mousedown",function(e){return i.onMouseDown(e)})),i.viewListeners.push(kc(i.domNode,"mouseup",function(e){return i.onMouseUp(e)})),i.viewListeners.push(kc(i.wrapper,"click",function(e){return i.onClick(e)})),i.viewListeners.push(kc(i.wrapper,"auxclick",function(e){return i.onClick(e)})),i.viewListeners.push(kc(i.domNode,"contextmenu",function(e){return i.onContextMenu(e)})),i.viewListeners.push(kc(i.wrapper,Mm.Tap,function(e){return i.onTap(e)})),i.viewListeners.push(kc(i.wrapper,Mm.Change,function(e){return i.onTouchChange(e)})),Xl&&(i.viewListeners.push(kc(i.wrapper,"MSPointerDown",function(e){return i.onMsPointerDown(e)})),i.viewListeners.push(kc(i.wrapper,"MSGestureTap",function(e){return i.onMsGestureTap(e)})),i.viewListeners.push(Gc(i.wrapper,"MSGestureChange",function(e){return i.onThrottledMsGestureChange(e)},function(e,t){t.stopPropagation(),t.preventDefault();var n={translationY:t.translationY,translationX:t.translationX};return e&&(n.translationY+=e.translationY,n.translationX+=e.translationX),n}))),i.viewListeners.push(kc(window,"dragover",function(e){return i.onDragOver(e)})),i.viewListeners.push(kc(i.wrapper,"drop",function(e){return i.onDrop(e)})),i.viewListeners.push(kc(window,"dragend",function(e){return i.onDragEnd(e)})),i.viewListeners.push(kc(window,"dragleave",function(e){return i.onDragOver(e)})),i.wrapper.appendChild(i.rowsContainer),i.domNode.appendChild(i.scrollableElement.getDomNode()),r.appendChild(i.domNode),i.lastRenderTop=0,i.lastRenderHeight=0,i.didJustPressContextMenuKey=!1,i.currentDropTarget=null,i.currentDropTargets=[],i.shouldInvalidateDropReaction=!1,i.dragAndDropScrollInterval=null,i.dragAndDropScrollTimeout=null,i.onHiddenScrollTop=null,i.onRowsChanged(),i.layout(),i.setupMSGesture(),i.applyStyles(n.options),i}return fN(t,e),Object.defineProperty(t.prototype,"onDOMFocus",{get:function(){return this._onDOMFocus.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDOMBlur",{get:function(){return this._onDOMBlur.event},enumerable:!0,configurable:!0}),t.prototype.applyStyles=function(e){this.treeStyler.style(e)},t.prototype.createViewItem=function(e){return new mN(this.context,e)},t.prototype.getHTMLElement=function(){return this.domNode},t.prototype.focus=function(){this.domNode.focus()},t.prototype.isFocused=function(){return document.activeElement===this.domNode},t.prototype.blur=function(){this.domNode.blur()},t.prototype.onVisible=function(){this.scrollTop=this.onHiddenScrollTop,this.onHiddenScrollTop=null,this.setupMSGesture()},t.prototype.setupMSGesture=function(){var e=this;window.MSGesture&&(this.msGesture=new MSGesture,setTimeout(function(){return e.msGesture.target=e.wrapper},100))},t.prototype.onHidden=function(){this.onHiddenScrollTop=this.scrollTop},t.prototype.isTreeVisible=function(){return null===this.onHiddenScrollTop},t.prototype.layout=function(e,t){this.isTreeVisible()&&(this.viewHeight=e||ih(this.wrapper),this.scrollHeight=this.getContentHeight(),this.horizontalScrolling&&(this.viewWidth=t||rh(this.wrapper)))},t.prototype.render=function(e,t,n,r,i){var o,s,a=e,u=e+t,l=this.lastRenderTop+this.lastRenderHeight;for(o=this.indexAfter(u)-1,s=this.indexAt(Math.max(l,a));o>=s;o--)this.insertItemInDOM(this.itemAtIndex(o));for(o=Math.min(this.indexAt(this.lastRenderTop),this.indexAfter(u))-1,s=this.indexAt(a);o>=s;o--)this.insertItemInDOM(this.itemAtIndex(o));for(o=this.indexAt(this.lastRenderTop),s=Math.min(this.indexAt(a),this.indexAfter(l));o1e3,l=void 0,c=void 0;if(!u)c=(l=new iN({getLength:function(){return o.length},getElementHash:function(e){return o[e]}},{getLength:function(){return s.length},getElementHash:function(e){return s[e].id}},null).ComputeDiff(!1)).some(function(e){if(e.modifiedLength>0)for(var n=e.modifiedStart,r=e.modifiedStart+e.modifiedLength;n0&&this.onRemoveItems(new tw(o,p.originalStart,p.originalStart+p.originalLength)),p.modifiedLength>0){var f=s[p.modifiedStart-1]||n;f=f.getDepth()>0?f:null,this.onInsertItems(new tw(s,p.modifiedStart,p.modifiedStart+p.modifiedLength),f?f.id:null)}}else(u||l.length)&&(this.onRemoveItems(new tw(o)),this.onInsertItems(new tw(s),n.getDepth()>0?n.id:null));(u||l.length)&&this.onRowsChanged()}},t.prototype.onItemRefresh=function(e){this.onItemsRefresh([e])},t.prototype.onItemsRefresh=function(e){var t=this;this.onRefreshItemSet(e.filter(function(e){return t.items.hasOwnProperty(e.id)})),this.onRowsChanged()},t.prototype.onItemExpanding=function(e){var t=this.items[e.item.id];t&&(t.expanded=!0)},t.prototype.onItemExpanded=function(e){var t=e.item,n=this.items[t.id];if(n){n.expanded=!0;var r=this.onInsertItems(t.getNavigator(),t.id),i=this.scrollTop;n.top+n.height<=this.scrollTop&&(i+=r),this.onRowsChanged(i)}},t.prototype.onItemCollapsing=function(e){var t=e.item,n=this.items[t.id];n&&(n.expanded=!1,this.onRemoveItems(new rw(t.getNavigator(),function(e){return e&&e.id})),this.onRowsChanged())},t.prototype.updateWidth=function(e){if(e&&e.isVisible()){var t=this.items[e.id];t&&(t.updateWidth(),this.updateScrollWidth())}},t.prototype.getRelativeTop=function(e){if(e&&e.isVisible()){var t=this.items[e.id];if(t)return(t.top-this.scrollTop)/(this.viewHeight-t.height)}return-1},t.prototype.onItemReveal=function(e){var t=e.item,n=e.relativeTop,r=this.items[t.id];if(r)if(null!==n){n=(n=n<0?0:n)>1?1:n;var i=r.height-this.viewHeight;this.scrollTop=i*n+r.top}else{var o=r.top+r.height,s=this.scrollTop+this.viewHeight;r.top=s&&(this.scrollTop=o-this.viewHeight)}},t.prototype.onItemAddTrait=function(e){var t=e.item,n=e.trait,r=this.items[t.id];r&&r.addClass(n),"highlighted"===n&&(Mc(this.domNode,n),r&&(this.highlightedItemWasDraggable=!!r.draggable,r.draggable&&(r.draggable=!1)))},t.prototype.onItemRemoveTrait=function(e){var t=e.item,n=e.trait,r=this.items[t.id];r&&r.removeClass(n),"highlighted"===n&&(Nc(this.domNode,n),this.highlightedItemWasDraggable&&(r.draggable=!0),this.highlightedItemWasDraggable=!1)},t.prototype.onModelFocusChange=function(){var e=this.model&&this.model.getFocus();Ic(this.domNode,"no-focused-item",!e),e?this.domNode.setAttribute("aria-activedescendant",Jt(this.context.dataSource.getId(this.context.tree,e))):this.domNode.removeAttribute("aria-activedescendant")},t.prototype.onInsertItem=function(e){var t=this;e.onDragStart=function(n){t.onDragStart(e,n)},e.needsRender=!0,this.refreshViewItem(e),this.items[e.id]=e},t.prototype.onRefreshItem=function(e,t){void 0===t&&(t=!1),e.needsRender=e.needsRender||t,this.refreshViewItem(e)},t.prototype.onRemoveItem=function(e){this.removeItemFromDOM(e),e.dispose(),delete this.items[e.id]},t.prototype.refreshViewItem=function(e){e.render(),this.shouldBeRendered(e)?this.insertItemInDOM(e):this.removeItemFromDOM(e)},t.prototype.onClick=function(e){if(!this.lastPointerType||"mouse"===this.lastPointerType){var t=new yc(e),n=this.getItemAround(t.target);n&&(Xl&&Date.now()-this.lastClickTimeStamp<300&&(t.detail=2),this.lastClickTimeStamp=Date.now(),this.context.controller.onClick(this.context.tree,n.model.getElement(),t))}},t.prototype.onMouseDown=function(e){if(this.didJustPressContextMenuKey=!1,this.context.controller.onMouseDown&&(!this.lastPointerType||"mouse"===this.lastPointerType)){var t=new yc(e);if(!(t.ctrlKey&&we.e&&we.d)){var n=this.getItemAround(t.target);n&&this.context.controller.onMouseDown(this.context.tree,n.model.getElement(),t)}}},t.prototype.onMouseUp=function(e){if(this.context.controller.onMouseUp&&(!this.lastPointerType||"mouse"===this.lastPointerType)){var t=new yc(e);if(!(t.ctrlKey&&we.e&&we.d)){var n=this.getItemAround(t.target);n&&this.context.controller.onMouseUp(this.context.tree,n.model.getElement(),t)}}},t.prototype.onTap=function(e){var t=this.getItemAround(e.initialTarget);t&&this.context.controller.onTap(this.context.tree,t.model.getElement(),e)},t.prototype.onTouchChange=function(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY},t.prototype.onContextMenu=function(e){var t,n;if(e instanceof KeyboardEvent||this.didJustPressContextMenuKey){this.didJustPressContextMenuKey=!1;var r,i=new hc(e);if(n=this.model.getFocus()){var o=this.context.dataSource.getId(this.context.tree,n);r=eh(this.items[o].element)}else n=this.model.getInput(),r=eh(this.inputItem.element);t=new dN(r.left+r.width,r.top,i)}else{var s=new yc(e),a=this.getItemAround(s.target);if(!a)return;n=a.model.getElement(),t=new hN(s)}this.context.controller.onContextMenu(this.context.tree,n,t)},t.prototype.onKeyDown=function(e){var t=new hc(e);this.didJustPressContextMenuKey=58===t.keyCode||t.shiftKey&&68===t.keyCode,this.didJustPressContextMenuKey&&(t.preventDefault(),t.stopPropagation()),t.target&&t.target.tagName&&"input"===t.target.tagName.toLowerCase()||this.context.controller.onKeyDown(this.context.tree,t)},t.prototype.onKeyUp=function(e){this.didJustPressContextMenuKey&&this.onContextMenu(e),this.didJustPressContextMenuKey=!1,this.context.controller.onKeyUp(this.context.tree,new hc(e))},t.prototype.onDragStart=function(e,n){if(!this.model.getHighlight()){var r,i=e.model.getElement(),o=this.model.getSelection();if(r=o.indexOf(i)>-1?o:[i],n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(pN,JSON.stringify([e.uri])),n.dataTransfer.setDragImage){var s=void 0;s=this.context.dnd.getDragLabel?this.context.dnd.getDragLabel(this.context.tree,r):String(r.length);var a=document.createElement("div");a.className="monaco-tree-drag-image",a.textContent=s,document.body.appendChild(a),n.dataTransfer.setDragImage(a,-10,-10),setTimeout(function(){return document.body.removeChild(a)},0)}this.currentDragAndDropData=new oN(r),t.currentExternalDragAndDropData=new sN(r),this.context.dnd.onDragStart(this.context.tree,this.currentDragAndDropData,new bc(n))}},t.prototype.setupDragAndDropScrollInterval=function(){var e=this,t=$c(this.wrapper).top;this.dragAndDropScrollInterval||(this.dragAndDropScrollInterval=window.setInterval(function(){if(void 0!==e.dragAndDropMouseY){var n=e.dragAndDropMouseY-t,r=0,i=e.viewHeight-35;n<35?r=Math.max(-14,.2*(n-35)):n>i&&(r=Math.min(14,.2*(n-i))),e.scrollTop+=r}},10),this.cancelDragAndDropScrollTimeout(),this.dragAndDropScrollTimeout=window.setTimeout(function(){e.cancelDragAndDropScrollInterval(),e.dragAndDropScrollTimeout=null},1e3))},t.prototype.cancelDragAndDropScrollInterval=function(){this.dragAndDropScrollInterval&&(window.clearInterval(this.dragAndDropScrollInterval),this.dragAndDropScrollInterval=null),this.cancelDragAndDropScrollTimeout()},t.prototype.cancelDragAndDropScrollTimeout=function(){this.dragAndDropScrollTimeout&&(window.clearTimeout(this.dragAndDropScrollTimeout),this.dragAndDropScrollTimeout=null)},t.prototype.onDragOver=function(e){var n,r=this,i=new bc(e),o=this.getItemAround(i.target);if(!o||0===i.posx&&0===i.posy&&i.browserEvent.type===ph.DRAG_LEAVE)return this.currentDropTarget&&(this.currentDropTargets.forEach(function(e){return e.dropTarget=!1}),this.currentDropTargets=[],this.currentDropPromise&&(this.currentDropPromise.cancel(),this.currentDropPromise=null)),this.cancelDragAndDropScrollInterval(),this.currentDropTarget=null,this.currentDropElement=null,this.dragAndDropMouseY=null,!1;if(this.setupDragAndDropScrollInterval(),this.dragAndDropMouseY=i.posy,!this.currentDragAndDropData)if(t.currentExternalDragAndDropData)this.currentDragAndDropData=t.currentExternalDragAndDropData;else{if(!i.dataTransfer.types)return!1;this.currentDragAndDropData=new aN}this.currentDragAndDropData.update(i);var s,a=o.model;do{if(n=a?a.getElement():this.model.getInput(),!(s=this.context.dnd.onDragOver(this.context.tree,this.currentDragAndDropData,n,i))||s.bubble!==$M.BUBBLE_UP)break;a=a&&a.parent}while(a);if(!a)return this.currentDropElement=null,!1;var u=s&&s.accept;u?(this.currentDropElement=a.getElement(),i.preventDefault(),i.dataTransfer.dropEffect=s.effect===JM.COPY?"copy":"move"):this.currentDropElement=null;var l,c,h=a.id===this.inputItem.id?this.inputItem:this.items[a.id];if((this.shouldInvalidateDropReaction||this.currentDropTarget!==h||(l=this.currentDropElementReaction,c=s,!(!l&&!c||l&&c&&l.accept===c.accept&&l.bubble===c.bubble&&l.effect===c.effect)))&&(this.shouldInvalidateDropReaction=!1,this.currentDropTarget&&(this.currentDropTargets.forEach(function(e){return e.dropTarget=!1}),this.currentDropTargets=[],this.currentDropPromise&&(this.currentDropPromise.cancel(),this.currentDropPromise=null)),this.currentDropTarget=h,this.currentDropElementReaction=s,u)){if(this.currentDropTarget&&(this.currentDropTarget.dropTarget=!0,this.currentDropTargets.push(this.currentDropTarget)),s.bubble===$M.BUBBLE_DOWN)for(var d,p=a.getNavigator();d=p.next();)(o=this.items[d.id])&&(o.dropTarget=!0,this.currentDropTargets.push(o));s.autoExpand&&(this.currentDropPromise=cn.b.timeout(500).then(function(){return r.context.tree.expand(r.currentDropElement)}).then(function(){return r.shouldInvalidateDropReaction=!0}))}return!0},t.prototype.onDrop=function(e){if(this.currentDropElement){var t=new bc(e);t.preventDefault(),this.currentDragAndDropData.update(t),this.context.dnd.drop(this.context.tree,this.currentDragAndDropData,this.currentDropElement,t),this.onDragEnd(e)}this.cancelDragAndDropScrollInterval()},t.prototype.onDragEnd=function(e){this.currentDropTarget&&(this.currentDropTargets.forEach(function(e){return e.dropTarget=!1}),this.currentDropTargets=[]),this.currentDropPromise&&(this.currentDropPromise.cancel(),this.currentDropPromise=null),this.cancelDragAndDropScrollInterval(),this.currentDragAndDropData=null,t.currentExternalDragAndDropData=null,this.currentDropElement=null,this.currentDropTarget=null,this.dragAndDropMouseY=null},t.prototype.onFocus=function(){this.context.options.alwaysFocused||Mc(this.domNode,"focused"),this._onDOMFocus.fire()},t.prototype.onBlur=function(){this.context.options.alwaysFocused||Nc(this.domNode,"focused"),this.domNode.removeAttribute("aria-activedescendant"),this._onDOMBlur.fire()},t.prototype.onMsPointerDown=function(e){if(this.msGesture){var t=e.pointerType;t!==(e.MSPOINTER_TYPE_MOUSE||"mouse")?t===(e.MSPOINTER_TYPE_TOUCH||"touch")&&(this.lastPointerType="touch",e.stopPropagation(),e.preventDefault(),this.msGesture.addPointer(e.pointerId)):this.lastPointerType="mouse"}},t.prototype.onThrottledMsGestureChange=function(e){this.scrollTop-=e.translationY},t.prototype.onMsGestureTap=function(e){e.initialTarget=document.elementFromPoint(e.clientX,e.clientY),this.onTap(e)},t.prototype.insertItemInDOM=function(e){var t=null,n=this.itemAfter(e);n&&n.element&&(t=n.element),e.insertInDOM(this.rowsContainer,t)},t.prototype.removeItemFromDOM=function(e){e&&e.removeFromDOM()},t.prototype.shouldBeRendered=function(e){return e.topthis.lastRenderTop},t.prototype.getItemAround=function(e){var n=this.inputItem;do{if(e[t.BINDING]&&(n=e[t.BINDING]),e===this.wrapper||e===this.domNode)return n;if(e===document.body)return null}while(e=e.parentElement)},t.prototype.releaseModel=function(){this.model&&(this.modelListeners=on(this.modelListeners),this.model=null)},t.prototype.dispose=function(){var t=this;this.scrollableElement.dispose(),this.releaseModel(),this.modelListeners=null,this.viewListeners=on(this.viewListeners),this._onDOMFocus.dispose(),this._onDOMBlur.dispose(),this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.domNode=null,this.items&&(Object.keys(this.items).forEach(function(e){return t.items[e].removeFromDOM()}),this.items=null),this.context.cache&&(this.context.cache.dispose(),this.context.cache=null),e.prototype.dispose.call(this)},t.BINDING="monaco-tree-row",t.LOADING_DECORATION_DELAY=800,t.counter=0,t.currentExternalDragAndDropData=null,t}(uN),bN=function(){return function(e,t,n){if(void 0===n&&(n={}),this.tree=e,this.configuration=t,this.options=n,!t.dataSource)throw new Error("You must provide a Data Source to the tree.");this.dataSource=t.dataSource,this.renderer=t.renderer,this.controller=t.controller||new OM({clickBehavior:MM.ON_MOUSE_UP,keyboardSupport:"boolean"!=typeof n.keyboardSupport||n.keyboardSupport}),this.dnd=t.dnd||new PM,this.filter=t.filter||new BM,this.sorter=t.sorter||null,this.accessibilityProvider=t.accessibilityProvider||new RM,this.styler=t.styler||null}}(),_N={listFocusBackground:md.fromHex("#073655"),listActiveSelectionBackground:md.fromHex("#0E639C"),listActiveSelectionForeground:md.fromHex("#FFFFFF"),listFocusAndSelectionBackground:md.fromHex("#094771"),listFocusAndSelectionForeground:md.fromHex("#FFFFFF"),listInactiveSelectionBackground:md.fromHex("#3F3F46"),listHoverBackground:md.fromHex("#2A2D2E"),listDropBackground:md.fromHex("#383B3D")},CN=function(){function e(e,t,n){void 0===n&&(n={}),this._onDidChangeFocus=new On,this.onDidChangeFocus=this._onDidChangeFocus.event,this._onDidChangeSelection=new On,this.onDidChangeSelection=this._onDidChangeSelection.event,this._onHighlightChange=new On,this.onDidChangeHighlight=this._onHighlightChange.event,this._onDidExpandItem=new On,this.onDidExpandItem=this._onDidExpandItem.event,this._onDidCollapseItem=new On,this.onDidCollapseItem=this._onDidCollapseItem.event,this._onDispose=new wn,this.onDidDispose=this._onDispose.event,this.container=e,ds(n,_N,!1),n.twistiePixels="number"==typeof n.twistiePixels?n.twistiePixels:32,n.showTwistie=!1!==n.showTwistie,n.indentPixels="number"==typeof n.indentPixels?n.indentPixels:12,n.alwaysFocused=!0===n.alwaysFocused,n.useShadows=!1!==n.useShadows,n.paddingOnRow=!1!==n.paddingOnRow,this.context=new bN(this,t,n),this.model=new KM(this.context),this.view=new yN(this.context,this.container),this.view.setModel(this.model),this._onDidChangeFocus.input=this.model.onDidFocus,this._onDidChangeSelection.input=this.model.onDidSelect,this._onHighlightChange.input=this.model.onDidHighlight,this._onDidExpandItem.input=this.model.onDidExpandItem,this._onDidCollapseItem.input=this.model.onDidCollapseItem}return e.prototype.style=function(e){this.view.applyStyles(e)},Object.defineProperty(e.prototype,"onDidFocus",{get:function(){return this.view&&this.view.onDOMFocus},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidBlur",{get:function(){return this.view&&this.view.onDOMBlur},enumerable:!0,configurable:!0}),e.prototype.getHTMLElement=function(){return this.view.getHTMLElement()},e.prototype.layout=function(e,t){this.view.layout(e,t)},e.prototype.domFocus=function(){this.view.focus()},e.prototype.isDOMFocused=function(){return this.view.isFocused()},e.prototype.domBlur=function(){this.view.blur()},e.prototype.onVisible=function(){this.view.onVisible()},e.prototype.onHidden=function(){this.view.onHidden()},e.prototype.setInput=function(e){return this.model.setInput(e)},e.prototype.getInput=function(){return this.model.getInput()},e.prototype.refresh=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!0),this.model.refresh(e,t)},e.prototype.updateWidth=function(e){var t=this.model.getItem(e);return this.view.updateWidth(t)},e.prototype.expand=function(e){return this.model.expand(e)},e.prototype.expandAll=function(e){return this.model.expandAll(e)},e.prototype.collapse=function(e,t){return void 0===t&&(t=!1),this.model.collapse(e,t)},e.prototype.collapseAll=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),this.model.collapseAll(e,t)},e.prototype.collapseDeepestExpandedLevel=function(){return this.model.collapseDeepestExpandedLevel()},e.prototype.toggleExpansion=function(e,t){return void 0===t&&(t=!1),this.model.toggleExpansion(e,t)},e.prototype.toggleExpansionAll=function(e){return this.model.toggleExpansionAll(e)},e.prototype.isExpanded=function(e){return this.model.isExpanded(e)},e.prototype.getExpandedElements=function(){return this.model.getExpandedElements()},e.prototype.reveal=function(e,t){return void 0===t&&(t=null),this.model.reveal(e,t)},e.prototype.getRelativeTop=function(e){var t=this.model.getItem(e);return this.view.getRelativeTop(t)},e.prototype.getScrollPosition=function(){return this.view.getScrollPosition()},e.prototype.setScrollPosition=function(e){this.view.setScrollPosition(e)},e.prototype.getContentHeight=function(){return this.view.getContentHeight()},e.prototype.setHighlight=function(e,t){this.model.setHighlight(e,t)},e.prototype.getHighlight=function(){return this.model.getHighlight()},e.prototype.isHighlighted=function(e){return this.model.isFocused(e)},e.prototype.clearHighlight=function(e){this.model.setHighlight(null,e)},e.prototype.select=function(e,t){this.model.select(e,t)},e.prototype.selectRange=function(e,t,n){this.model.selectRange(e,t,n)},e.prototype.deselectRange=function(e,t,n){this.model.deselectRange(e,t,n)},e.prototype.selectAll=function(e,t){this.model.selectAll(e,t)},e.prototype.deselect=function(e,t){this.model.deselect(e,t)},e.prototype.deselectAll=function(e,t){this.model.deselectAll(e,t)},e.prototype.setSelection=function(e,t){this.model.setSelection(e,t)},e.prototype.toggleSelection=function(e,t){this.model.toggleSelection(e,t)},e.prototype.isSelected=function(e){return this.model.isSelected(e)},e.prototype.getSelection=function(){return this.model.getSelection()},e.prototype.clearSelection=function(e){this.model.setSelection([],e)},e.prototype.selectNext=function(e,t,n){this.model.selectNext(e,t,n)},e.prototype.selectPrevious=function(e,t,n){this.model.selectPrevious(e,t,n)},e.prototype.selectParent=function(e,t){this.model.selectParent(e,t)},e.prototype.setFocus=function(e,t){this.model.setFocus(e,t)},e.prototype.isFocused=function(e){return this.model.isFocused(e)},e.prototype.getFocus=function(){return this.model.getFocus()},e.prototype.focusNext=function(e,t){this.model.focusNext(e,t)},e.prototype.focusPrevious=function(e,t){this.model.focusPrevious(e,t)},e.prototype.focusParent=function(e){this.model.focusParent(e)},e.prototype.focusFirstChild=function(e){this.model.focusFirstChild(e)},e.prototype.focusFirst=function(e,t){this.model.focusFirst(e,t)},e.prototype.focusNth=function(e,t){this.model.focusNth(e,t)},e.prototype.focusLast=function(e,t){this.model.focusLast(e,t)},e.prototype.focusNextPage=function(e){this.view.focusNextPage(e)},e.prototype.focusPreviousPage=function(e){this.view.focusPreviousPage(e)},e.prototype.clearFocus=function(e){this.model.setFocus(null,e)},e.prototype.addTraits=function(e,t){this.model.addTraits(e,t)},e.prototype.removeTraits=function(e,t){this.model.removeTraits(e,t)},e.prototype.toggleTrait=function(e,t){this.model.hasTrait(e,t)?this.model.removeTraits(e,[t]):this.model.addTraits(e,[t])},e.prototype.hasTrait=function(e,t){return this.model.hasTrait(e,t)},e.prototype.getNavigator=function(e,t){return new iw(this.model.getNavigator(e,t),function(e){return e&&e.getElement()})},e.prototype.dispose=function(){this._onDispose.fire(),null!==this.model&&(this.model.dispose(),this.model=null),null!==this.view&&(this.view.dispose(),this.view=null),this._onDidChangeFocus.dispose(),this._onDidChangeSelection.dispose(),this._onHighlightChange.dispose(),this._onDidExpandItem.dispose(),this._onDidCollapseItem.dispose(),this._onDispose.dispose()},e}(),wN=(new Au("inputFocus",!1),function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),DN=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},AN=function(e,t){return function(n,r){t(n,r,e)}},SN=Or("listService"),xN=function(){function e(e){this.lists=[],this._lastFocusedWidget=void 0}return Object.defineProperty(e.prototype,"lastFocusedList",{get:function(){return this._lastFocusedWidget},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this;if(this.lists.some(function(t){return t.widget===e}))throw new Error("Cannot register the same widget multiple times");var r={widget:e,extraContextKeys:t};return this.lists.push(r),e.isDOMFocused()&&(this._lastFocusedWidget=e),sn([e.onDidFocus(function(){return n._lastFocusedWidget=e}),an(function(){return n.lists.splice(n.lists.indexOf(r),1)}),e.onDidDispose(function(){n.lists=n.lists.filter(function(e){return e!==r}),n._lastFocusedWidget===e&&(n._lastFocusedWidget=void 0)})])},e=EN([AN(0,Su)],e)}(),MN=new Au("listFocus",!0),NN=new Au("listSupportsMultiselect",!0),IN=(mu.and(MN,mu.not("inputFocus")),new Au("listDoubleSelection",!1)),LN=new Au("listMultiSelection",!1);function kN(e,t){var n=e.createScoped(t.getHTMLElement());return(t instanceof xC||t instanceof kM)&&NN.bindTo(n),MN.bindTo(n),n}var TN="workbench.list.multiSelectModifier",FN="workbench.list.openMode",ON="workbench.tree.horizontalScrolling";function PN(e){return"alt"===e.getValue(TN)}function BN(e){return"doubleClick"!==e.getValue(FN)}var RN,jN,zN=function(){function e(e){this.configurationService=e}return e.prototype.isSelectionSingleChangeEvent=function(e){return PN(this.configurationService)?e.browserEvent.altKey:fC(e)},e.prototype.isSelectionRangeChangeEvent=function(e){return gC(e)},e}(),WN=function(){function e(e,t){this.configurationService=e,this.existingOpenController=t}return e.prototype.shouldOpen=function(e){if(e instanceof MouseEvent){var t=2===e.detail;return!(!BN(this.configurationService)&&!t)&&((0===e.button||1===e.button)&&(!this.existingOpenController||this.existingOpenController.shouldOpen(e)))}return!this.existingOpenController||this.existingOpenController.shouldOpen(e)},e}();function VN(e,t){return!1===e.multipleSelectionSupport||e.multipleSelectionController||(e.multipleSelectionController=new zN(t)),e.openController=new WN(t,e.openController),e}function HN(){return RN||(RN=uh()),RN}function UN(e,t){return e.controller||(e.controller=t.createInstance(GN,{})),e.styler||(e.styler=new jM((jN||(jN=uh()),jN))),e}(function(e){function t(t,n,r,i,o,s,a,u){var l=e.call(this,t,n,r,DN({keyboardSupport:!1,selectOnMouseDown:!0,styleController:new _C(HN())},EM(a.getTheme(),xM),VN(i,u)))||this;return l.configurationService=u,l.contextKeyService=kN(o,l),l.listDoubleSelection=IN.bindTo(l.contextKeyService),l.listMultiSelection=LN.bindTo(l.contextKeyService),l._useAltAsMultipleSelectionModifier=PN(u),l.disposables.push(sn([l.contextKeyService,s.register(l),SM(l,a),l.onSelectionChange(function(){var e=l.getSelection();l.listMultiSelection.set(e.length>1),l.listDoubleSelection.set(2===e.length)})])),l.registerListeners(),l}wN(t,e),t.prototype.registerListeners=function(){var e=this;this.disposables.push(this.configurationService.onDidChangeConfiguration(function(t){t.affectsConfiguration(TN)&&(e._useAltAsMultipleSelectionModifier=PN(e.configurationService))}))},Object.defineProperty(t.prototype,"useAltAsMultipleSelectionModifier",{get:function(){return this._useAltAsMultipleSelectionModifier},enumerable:!0,configurable:!0}),t=EN([AN(4,Su),AN(5,SN),AN(6,Og),AN(7,wA)],t)})(xC),function(e){function t(t,n,r,i,o,s,a,u){var l=e.call(this,t,n,r,DN({keyboardSupport:!1,selectOnMouseDown:!0,styleController:new _C(HN())},EM(a.getTheme(),xM),VN(i,u)))||this;return l.configurationService=u,l.disposables=[],l.contextKeyService=kN(o,l),l._useAltAsMultipleSelectionModifier=PN(u),l.disposables.push(sn([l.contextKeyService,s.register(l),SM(l,a)])),l.registerListeners(),l}wN(t,e),t.prototype.registerListeners=function(){var e=this;this.disposables.push(this.configurationService.onDidChangeConfiguration(function(t){t.affectsConfiguration(TN)&&(e._useAltAsMultipleSelectionModifier=PN(e.configurationService))}))},Object.defineProperty(t.prototype,"useAltAsMultipleSelectionModifier",{get:function(){return this._useAltAsMultipleSelectionModifier},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this),this.disposables=on(this.disposables)},t=EN([AN(4,Su),AN(5,SN),AN(6,Og),AN(7,wA)],t)}(kM);var YN=function(e){function t(t,n,r,i,o,s,a,u){var l=this,c=UN(n,a),h=u.getValue(ON)?rs.Auto:rs.Hidden,d=DN({horizontalScrollMode:h,keyboardSupport:!1},EM(s.getTheme(),xM),r);return(l=e.call(this,t,c,d)||this).disposables=[],l.contextKeyService=kN(i,l),l.listDoubleSelection=IN.bindTo(l.contextKeyService),l.listMultiSelection=LN.bindTo(l.contextKeyService),l._openOnSingleClick=BN(u),l._useAltAsMultipleSelectionModifier=PN(u),l.disposables.push(l.contextKeyService,o.register(l),SM(l,s)),l.disposables.push(l.onDidChangeSelection(function(){var e=l.getSelection();l.listDoubleSelection.set(e&&2===e.length),l.listMultiSelection.set(e&&e.length>1)})),l.disposables.push(u.onDidChangeConfiguration(function(e){e.affectsConfiguration(FN)&&(l._openOnSingleClick=BN(u)),e.affectsConfiguration(TN)&&(l._useAltAsMultipleSelectionModifier=PN(u))})),l}return wN(t,e),Object.defineProperty(t.prototype,"openOnSingleClick",{get:function(){return this._openOnSingleClick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useAltAsMultipleSelectionModifier",{get:function(){return this._useAltAsMultipleSelectionModifier},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this),this.disposables=on(this.disposables)},t=EN([AN(3,Su),AN(4,SN),AN(5,Og),AN(6,Tr),AN(7,wA)],t)}(CN);var ZN,GN=function(e){function t(t,n){var r=e.call(this,function(e){return"boolean"!=typeof e.keyboardSupport&&(e.keyboardSupport=!1),"number"!=typeof e.clickBehavior&&(e.clickBehavior=MM.ON_MOUSE_DOWN),e}(t))||this;return r.configurationService=n,r.disposables=[],Kr(t.openMode)&&(r.setOpenMode(r.getOpenModeSetting()),r.registerListeners()),r}return wN(t,e),t.prototype.registerListeners=function(){var e=this;this.disposables.push(this.configurationService.onDidChangeConfiguration(function(t){t.affectsConfiguration(FN)&&e.setOpenMode(e.getOpenModeSetting())}))},t.prototype.getOpenModeSetting=function(){return BN(this.configurationService)?NM.SINGLE_CLICK:NM.DOUBLE_CLICK},t.prototype.dispose=function(){this.disposables=on(this.disposables)},t=EN([AN(1,wA)],t)}(OM);!function(e){function t(t,n){var r=e.call(this)||this;return r.tree=t,r.options=n,r._openResource=new wn,r.openResource=r._openResource.event,r.registerListeners(),r}wN(t,e),t.prototype.registerListeners=function(){var e=this;this.options&&this.options.openOnFocus&&this._register(this.tree.onDidChangeFocus(function(t){return e.onFocus(t)})),this._register(this.tree.onDidChangeSelection(function(t){return e.onSelection(t)}))},t.prototype.onFocus=function(e){var t=e.payload,n=this.tree.getFocus();this.tree.setSelection([n],{fromFocus:!0});var r=t&&t.originalEvent,i=t&&"mouse"===t.origin,o=i&&r&&2===r.detail;t&&t.preventOpenOnFocus||i&&!this.tree.openOnSingleClick&&!o||this._openResource.fire({editorOptions:{preserveFocus:!0,pinned:!1,revealIfVisible:!0},sideBySide:!1,element:n,payload:t})},t.prototype.onSelection=function(e){var t=e.payload;if(!t||!t.fromFocus){var n=t&&t.originalEvent,r=t&&"mouse"===t.origin,i=r&&n&&2===n.detail;if(!r||this.tree.openOnSingleClick||i){i&&n&&n.preventDefault();var o=t&&"keyboard"===t.origin,s=n&&(n.ctrlKey||n.metaKey||n.altKey),a=!(o&&(!t||!t.preserveFocus)||i||t&&t.focusEditor);this._openResource.fire({editorOptions:{preserveFocus:a,pinned:i,revealIfVisible:!0},sideBySide:s,element:this.tree.getSelection()[0],payload:t})}}}}(un);su.as(tp.Configuration).registerConfiguration({id:"workbench",order:7,title:ns("workbenchConfigurationTitle","Workbench"),type:"object",properties:(ZN={},ZN[TN]={type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[ns("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),ns("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:ns({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). `ctrlCmd` maps to `Control` on Windows and Linux and to `Command` on macOS. The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},ZN[FN]={type:"string",enum:["singleClick","doubleClick"],enumDescriptions:[ns("openMode.singleClick","Opens items on mouse single click."),ns("openMode.doubleClick","Open items on mouse double click.")],default:"singleClick",description:ns({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Set to `singleClick` to open items with a single mouse click and `doubleClick` to only open via mouse double click. For parents with children in trees, this setting will control if a single click expands the parent or a double click. Note that some trees and lists might choose to ignore this setting if it is not applicable. ")},ZN[ON]={type:"boolean",default:!1,description:ns("horizontalScrolling setting","Controls whether trees support horizontal scrolling in the workbench.")},ZN)});var KN=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qN=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},QN=function(e,t){return function(n,r){t(n,r,e)}},XN=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},JN=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1?this.badge.setTitleFormat(ns("referencesCount","{0} references",t)):this.badge.setTitleFormat(ns("referenceCount","{0} reference",t))},e=qN([QN(1,cM),QN(2,Pr(IM)),QN(3,Og)],e)}(),rI=function(){function e(e){var t=document.createElement("div");this.before=document.createElement("span"),this.inside=document.createElement("span"),this.after=document.createElement("span"),Mc(this.inside,"referenceMatch"),Mc(t,"reference"),t.appendChild(this.before),t.appendChild(this.inside),t.appendChild(this.after),e.appendChild(t)}return e.prototype.set=function(e){var t=e.parent.preview.preview(e.range),n=t.before,r=t.inside,i=t.after;this.before.innerHTML=et(n),this.inside.innerHTML=et(r),this.after.innerHTML=et(i)},e}(),iI=function(){function e(e,t,n){this._contextService=e,this._themeService=t,this._environmentService=n}return e.prototype.getHeight=function(e,t){return 23},e.prototype.getTemplateId=function(t,n){if(n instanceof CM)return e._ids.FileReferences;if(n instanceof bM)return e._ids.OneReference;throw n},e.prototype.renderTemplate=function(t,n,r){if(n===e._ids.FileReferences)return new nI(r,this._contextService,this._environmentService,this._themeService);if(n===e._ids.OneReference)return new rI(r);throw n},e.prototype.renderElement=function(e,t,n,r){if(t instanceof CM)r.set(t);else{if(!(t instanceof bM))throw n;r.set(t)}},e.prototype.disposeTemplate=function(e,t,n){n instanceof nI&&n.dispose()},e._ids={FileReferences:"FileReferences",OneReference:"OneReference"},e=qN([QN(0,cM),QN(1,Og),QN(2,Pr(IM))],e)}(),oI=function(){function e(){}return e.prototype.getAriaLabel=function(e,t){return t instanceof CM?t.getAriaMessage():t instanceof bM?t.getAriaMessage():void 0},e}(),sI=function(){function e(e,t){var n,r=this;this._disposables=[],this._onDidChangePercentages=new wn,this._ratio=t,this._sash=new pD(e,{getVerticalSashLeft:function(){return r._width*r._ratio},getVerticalSashHeight:function(){return r._height}}),this._disposables.push(this._sash.onDidStart(function(e){n=e.startX-r._width*r.ratio})),this._disposables.push(this._sash.onDidChange(function(e){var t=e.currentX-n;t>20&&t+200?e.children[0]:void 0},t.prototype._revealReference=function(e,t){return XN(this,void 0,cn.b,function(){var n,r=this;return JN(this,function(i){switch(i.label){case 0:return e.uri.scheme!==Md.inMemory?this.setTitle(e.name,IE(e.directory,this._contextService,this._environmentService)):this.setTitle(ns("peekView.alternateTitle","References")),n=this._textModelResolverService.createModelReference(e.uri),t?[4,this._tree.reveal(e.parent)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2,cn.b.join([n,this._tree.reveal(e)]).then(function(t){var n=t[0];if(r._model){on(r._previewModelReference);var i=n.object;if(i){r._previewModelReference=n;var o=r._preview.getModel()===i.textEditorModel;r._preview.setModel(i.textEditorModel);var s=be.lift(e.range).collapseToStart();r._preview.setSelection(s),r._preview.revealRangeInCenter(s,o?0:1)}else r._preview.setModel(r._previewNotAvailableMessage),n.dispose()}else n.dispose()},pn)]}})})},t}(Jx),lI=lf("peekViewTitle.background",{dark:"#1E1E1E",light:"#FFFFFF",hc:"#0C141F"},ns("peekViewTitleBackground","Background color of the peek view title area.")),cI=lf("peekViewTitleLabel.foreground",{dark:"#FFFFFF",light:"#333333",hc:"#FFFFFF"},ns("peekViewTitleForeground","Color of the peek view title.")),hI=lf("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#6c6c6cb3",hc:"#FFFFFF99"},ns("peekViewTitleInfoForeground","Color of the peek view title info.")),dI=lf("peekView.border",{dark:"#007acc",light:"#007acc",hc:gf},ns("peekViewBorder","Color of the peek view borders and arrow.")),pI=lf("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hc:md.black},ns("peekViewResultsBackground","Background color of the peek view result list.")),fI=lf("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hc:md.white},ns("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),gI=lf("peekViewResult.fileForeground",{dark:md.white,light:"#1E1E1E",hc:md.white},ns("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),mI=lf("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hc:null},ns("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),vI=lf("peekViewResult.selectionForeground",{dark:md.white,light:"#6C6C6C",hc:md.white},ns("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list.")),yI=lf("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hc:md.black},ns("peekViewEditorBackground","Background color of the peek view editor.")),bI=lf("peekViewEditorGutter.background",{dark:yI,light:yI,hc:yI},ns("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),_I=lf("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hc:null},ns("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),CI=lf("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hc:null},ns("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),wI=lf("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hc:mf},ns("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));Vg(function(e,t){var n=e.getColor(_I);n&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree .referenceMatch { background-color: "+n+"; }");var r=e.getColor(CI);r&&t.addRule(".monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: "+r+"; }");var i=e.getColor(wI);i&&t.addRule(".monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid "+i+"; box-sizing: border-box; }");var o=e.getColor(mf);o&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree .referenceMatch { border: 1px dotted "+o+"; box-sizing: border-box; }");var s=e.getColor(pI);s&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree { background-color: "+s+"; }");var a=e.getColor(fI);a&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree { color: "+a+"; }");var u=e.getColor(gI);u&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree .reference-file { color: "+u+"; }");var l=e.getColor(mI);l&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { background-color: "+l+"; }");var c=e.getColor(vI);c&&t.addRule(".monaco-editor .reference-zone-widget .ref-tree .monaco-tree.focused .monaco-tree-rows > .monaco-tree-row.selected:not(.highlighted) { color: "+c+" !important; }");var h=e.getColor(yI);h&&t.addRule(".monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input {\tbackground-color: "+h+";}");var d=e.getColor(bI);d&&t.addRule(".monaco-editor .reference-zone-widget .preview .monaco-editor .margin {\tbackground-color: "+d+";}")});var DI=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},EI=function(e,t){return function(n,r){t(n,r,e)}},AI=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},SI=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},LI=function(e,t){return function(n,r){t(n,r,e)}},kI={getMetaTitle:function(e){return e.references.length>1&&ns("meta.titleReference"," – {0} references",e.references.length)}},TI=function(){function e(e,t){e instanceof qx&&Ux.inPeekEditor.bindTo(t)}return e.prototype.dispose=function(){},e.prototype.getId=function(){return e.ID},e.ID="editor.contrib.referenceController",e=II([LI(1,Su)],e)}(),FI=function(e){function t(){return e.call(this,{id:"editor.action.referenceSearch.trigger",label:ns("references.action.label","Find All References"),alias:"Find All References",precondition:mu.and(nl.hasReferenceProvider,Ux.notInPeekEditor,nl.isInEmbeddedEditor.toNegated()),kbOpts:{kbExpr:nl.editorTextFocus,primary:1094},menuOpts:{group:"navigation",order:1.5}})||this}return NI(t,e),t.prototype.run=function(e,t){var n=MI.get(t);if(n){var r=t.getSelection(),i=BI(t.getModel(),r.getStartPosition()).then(function(e){return new wM(e)});n.toggleWidget(r,i,kI)}},t}(qu);el(TI),$u(FI);function OI(e,t){PI(e,function(e){return e.closeWidget()})}function PI(e,t){var n=function(e){var t=e.get(Wu).getFocusedCodeEditor();return t instanceof qx?t.getParentEditor():t}(e);if(n){var r=MI.get(n);r&&t(r)}}function BI(e,t){var n=li.ordered(e).map(function(n){return Pl(function(r){return n.provideReferences(e,t,{includeDeclaration:!0},r)}).then(function(e){if(Array.isArray(e))return e},function(e){fn(e)})});return cn.b.join(n).then(function(e){for(var t=[],n=0,r=e;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},HI=function(e,t){return function(n,r){t(n,r,e)}},UI=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},YI=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&(this._edits=this._edits.map(function(e,t){return{value:e,index:t}}).sort(function(e,t){var n=be.compareRangesUsingStarts(e.value.range,t.value.range);return 0===n&&(n=e.index-t.index),n}).map(function(e){return e.value}),this._initialSelections=this._getInitialSelections(),this._model.pushStackElement(),this._model.pushEditOperations(this._initialSelections,this._edits,function(t){return e._getEndCursorSelections(t)}),this._model.pushStackElement()),void 0!==this._newEol&&(this._model.pushStackElement(),this._model.setEOL(this._newEol),this._model.pushStackElement())},e.prototype._getInitialSelections=function(){var e=this._edits[0].range;return[new Ii(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn)]},e.prototype._getEndCursorSelections=function(e){for(var t=0,n=0;n1&&t>1?ns("summary.nm","Made {0} text edits in {1} files",e,t):ns("summary.n0","Made {0} text edits in one file",e,t)},e.prototype.perform=function(){return UI(this,void 0,cn.b,function(){var e,t,n,r,i,o,s,a,u,l,c,h,d=this;return YI(this,function(p){switch(p.label){case 0:for(e=new Set,t=0,n=[],i=0,o=this._edits;i0)throw r.dispose(),new Error(ns("conflict","These files have changed in the meantime: {0}",i.join(", ")));return[4,r.apply()];case 2:return o=s.sent(),r.dispose(),[2,o]}})})},e=VI([HI(2,DM),HI(3,Pr(iM))],e)}(),XI=(n(359),function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}),JI=function(e,t){return function(n,r){t(n,r,e)}},$I=function(){function e(e,t){var n=this;this.themeService=t,this._disposables=[],this.allowEditorOverflow=!0,this._currentAcceptInput=null,this._currentCancelInput=null,this._editor=e,this._editor.addContentWidget(this),this._disposables.push(e.onDidChangeConfiguration(function(e){e.fontInfo&&n.updateFont()})),this._disposables.push(t.onThemeChange(function(e){return n.onThemeChange(e)}))}return e.prototype.onThemeChange=function(e){this.updateStyles(e)},e.prototype.dispose=function(){this._disposables=on(this._disposables),this._editor.removeContentWidget(this)},e.prototype.getId=function(){return"__renameInputWidget"},e.prototype.getDomNode=function(){return this._domNode||(this._inputField=document.createElement("input"),this._inputField.className="rename-input",this._inputField.type="text",this._inputField.setAttribute("aria-label",ns("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode=document.createElement("div"),this._domNode.style.height=this._editor.getConfiguration().lineHeight+"px",this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputField),this.updateFont(),this.updateStyles(this.themeService.getTheme())),this._domNode},e.prototype.updateStyles=function(e){if(this._inputField){var t=e.getColor(_f),n=e.getColor(Cf),r=e.getColor(bf),i=e.getColor(wf);this._inputField.style.backgroundColor=t?t.toString():null,this._inputField.style.color=n?n.toString():null,this._inputField.style.borderWidth=i?"1px":"0px",this._inputField.style.borderStyle=i?"solid":"none",this._inputField.style.borderColor=i?i.toString():"none",this._domNode.style.boxShadow=r?" 0 2px 8px "+r:null}},e.prototype.updateFont=function(){if(this._inputField){var e=this._editor.getConfiguration().fontInfo;this._inputField.style.fontFamily=e.fontFamily,this._inputField.style.fontWeight=e.fontWeight,this._inputField.style.fontSize=e.fontSize+"px"}},e.prototype.getPosition=function(){return this._visible?{position:this._position,preference:[Bu.BELOW,Bu.ABOVE]}:null},e.prototype.acceptInput=function(){this._currentAcceptInput&&this._currentAcceptInput()},e.prototype.cancelInput=function(e){this._currentCancelInput&&this._currentCancelInput(e)},e.prototype.getInput=function(e,t,n,r){var i=this;this._position=new ye(e.startLineNumber,e.startColumn),this._inputField.value=t,this._inputField.setAttribute("selectionStart",n.toString()),this._inputField.setAttribute("selectionEnd",r.toString()),this._inputField.size=Math.max(1.1*(e.endColumn-e.startColumn),20);var o,s=[];return o=function(){on(s),i._hide()},new cn.b(function(n){i._currentCancelInput=function(e){return i._currentAcceptInput=null,i._currentCancelInput=null,n(e),!0},i._currentAcceptInput=function(){0!==i._inputField.value.trim().length&&i._inputField.value!==t?(i._currentAcceptInput=null,i._currentCancelInput=null,n(i._inputField.value)):i.cancelInput(!0)};s.push(i._editor.onDidChangeCursorSelection(function(){be.containsPosition(e,i._editor.getPosition())||i.cancelInput(!0)})),s.push(i._editor.onDidBlurEditor(function(){return i.cancelInput(!1)})),i._show()},function(){i._currentCancelInput(!0)}).then(function(e){return o(),e},function(e){return o(),cn.b.wrapError(e)})},e.prototype._show=function(){var e=this;this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._editor.layoutContentWidget(this),setTimeout(function(){e._inputField.focus(),e._inputField.setSelectionRange(parseInt(e._inputField.getAttribute("selectionStart")),parseInt(e._inputField.getAttribute("selectionEnd")))},100)},e.prototype._hide=function(){this._visible=!1,this._editor.layoutContentWidget(this)},e=XI([JI(1,Og)],e)}(),eL=(n(360),function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),tL=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},nL=function(e,t){return function(n,r){t(n,r,e)}},rL=function(e){function t(n,r){var i=e.call(this)||this;return i._messageListeners=[],i._editor=n,i._visible=t.MESSAGE_VISIBLE.bindTo(r),i._register(i._editor.onDidAttemptReadOnlyEdit(function(){return i._onDidAttemptReadOnlyEdit()})),i}return eL(t,e),t.get=function(e){return e.getContribution(t._id)},t.prototype.getId=function(){return t._id},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._visible.reset()},t.prototype.isVisible=function(){return this._visible.get()},t.prototype.showMessage=function(e,t){var n,r=this;Vw(e),this._visible.set(!0),on(this._messageWidget),this._messageListeners=on(this._messageListeners),this._messageWidget=new iL(this._editor,t,e),this._messageListeners.push(this._editor.onDidBlurEditorText(function(){return r.closeMessage()})),this._messageListeners.push(this._editor.onDidChangeCursorPosition(function(){return r.closeMessage()})),this._messageListeners.push(this._editor.onDidDispose(function(){return r.closeMessage()})),this._messageListeners.push(this._editor.onDidChangeModel(function(){return r.closeMessage()})),this._messageListeners.push(function(e,t){for(var n=[],r=2;r=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},aL=function(e,t){return function(n,r){t(n,r,e)}},uL=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},lL=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0},e.prototype.resolveRenameLocation=function(){return uL(this,void 0,cn.b,function(){var e,t,n,r=this;return lL(this,function(i){switch(i.label){case 0:return(e=this._provider[0]).resolveRenameLocation?[4,Pl(function(t){return e.resolveRenameLocation(r.model,r.position,t)})]:[3,2];case 1:t=i.sent(),i.label=2;case 2:return t||(n=this.model.getWordAtPosition(this.position))&&(t={range:new be(this.position.lineNumber,n.startColumn,this.position.lineNumber,n.endColumn),text:n.word}),[2,t]}})})},e.prototype.provideRenameEdits=function(e,t,n,r){return void 0===t&&(t=0),void 0===n&&(n=[]),void 0===r&&(r=this.position),uL(this,void 0,cn.b,function(){var r,i,o=this;return lL(this,function(s){switch(s.label){case 0:return t>=this._provider.length?[2,{edits:void 0,rejectReason:n.join("\n")}]:(r=this._provider[t],[4,Pl(function(t){return r.provideRenameEdits(o.model,o.position,e,t)})]);case 1:return(i=s.sent())?i.rejectReason?[2,this.provideRenameEdits(e,t+1,n.concat(i.rejectReason))]:[2,i]:[2,this.provideRenameEdits(e,t+1,n.concat(ns("no result","No result.")))]}})})},e}();var hL=new Au("renameInputVisible",!1),dL=function(){function e(e,t,n,r,i,o,s){this.editor=e,this._notificationService=t,this._textModelResolverService=n,this._progressService=r,this._fileService=s,this._renameInputField=new $I(e,o),this._renameInputVisible=hL.bindTo(i)}return e.get=function(t){return t.getContribution(e.ID)},e.prototype.dispose=function(){this._renameInputField.dispose()},e.prototype.getId=function(){return e.ID},e.prototype.run=function(){return uL(this,void 0,cn.b,function(){var e,t,n,r,i,o,s,a=this;return lL(this,function(u){switch(u.label){case 0:e=this.editor.getPosition(),t=new cL(this.editor.getModel(),e),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,t.resolveRenameLocation()];case 2:return n=u.sent(),[3,4];case 3:return r=u.sent(),rL.get(this.editor).showMessage(r,e),[2,void 0];case 4:return n?(i=this.editor.getSelection(),o=0,s=n.text.length,be.isEmpty(i)||be.spansMultipleLines(i)||!be.containsRange(n.range,i)||(o=Math.max(0,i.startColumn-n.range.startColumn),s=Math.min(n.range.endColumn,i.endColumn)-n.range.startColumn),this._renameInputVisible.set(!0),[2,this._renameInputField.getInput(n.range,n.text,o,s).then(function(e){if(a._renameInputVisible.reset(),"boolean"!=typeof e){a.editor.focus();var r=new QI(a.editor,null,a._textModelResolverService,a._fileService),i=new lE(a.editor,15),o=t.provideRenameEdits(e,0,[],be.lift(n.range).getStartPosition()).then(function(t){if(!t.rejectReason)return r.add(t.edits),r.perform().then(function(t){t&&a.editor.setSelection(t),Vw(ns("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",n.text,e,r.ariaMessage()))});i.validate(a.editor)?rL.get(a.editor).showMessage(t.rejectReason,a.editor.getPosition()):a._notificationService.info(t.rejectReason)},function(e){return a._notificationService.error(ns("rename.failed","Rename failed to execute.")),cn.b.wrapError(e)});return a._progressService.showWhile(o,250),o}e&&a.editor.focus()},function(e){return a._renameInputVisible.reset(),cn.b.wrapError(e)})]):[2,void 0]}})})},e.prototype.acceptRenameInput=function(){this._renameInputField.acceptInput()},e.prototype.cancelRenameInput=function(){this._renameInputField.cancelInput(!0)},e.ID="editor.contrib.renameController",e=sL([aL(1,Yb),aL(2,DM),aL(3,jI),aL(4,Su),aL(5,Og),aL(6,Pr(iM))],e)}(),pL=function(e){function t(){return e.call(this,{id:"editor.action.rename",label:ns("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:mu.and(nl.writable,nl.hasRenameProvider),kbOpts:{kbExpr:nl.editorTextFocus,primary:60},menuOpts:{group:"1_modification",order:1.1}})||this}return oL(t,e),t.prototype.run=function(e,t){var n=dL.get(t);if(n)return n.run()},t}(qu);el(dL),$u(pL);var fL=Ku.bindToContribution(dL.get);Ju(new fL({id:"acceptRenameInput",precondition:hL,handler:function(e){return e.acceptRenameInput()},kbOpts:{weight:au.WEIGHT.editorContrib(99),kbExpr:nl.focus,primary:3}})),Ju(new fL({id:"cancelRenameInput",precondition:hL,handler:function(e){return e.cancelRenameInput()},kbOpts:{weight:au.WEIGHT.editorContrib(99),kbExpr:nl.focus,primary:9,secondary:[1033]}})),Xu("_executeDocumentRenameProvider",function(e,t,n){var r=n.newName;if("string"!=typeof r)throw yn("newName");return function(e,t,n){return uL(this,void 0,cn.b,function(){return lL(this,function(r){return[2,new cL(e,t).provideRenameEdits(n)]})})}(e,t,r)});var gL=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mL=function(){function e(){}return Object.defineProperty(e.prototype,"range",{get:function(){return new be(this.start.lineNumber,this.start.column,this.end.lineNumber,this.end.column)},enumerable:!0,configurable:!0}),e}(),vL=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return gL(t,e),Object.defineProperty(t.prototype,"start",{get:function(){return this.hasChildren?this.children[0].start:this.parent.start},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.hasChildren?this.children[this.children.length-1].end:this.parent.end},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasChildren",{get:function(){return this.children&&this.children.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEmpty",{get:function(){return!this.hasChildren&&!this.parent},enumerable:!0,configurable:!0}),t.prototype.append=function(e){return!!e&&(e.parent=this,this.children||(this.children=[]),e instanceof t?e.children&&this.children.push.apply(this.children,e.children):this.children.push(e),!0)},t}(mL),yL=function(e){function t(){var t=e.call(this)||this;return t.elements=new vL,t.elements.parent=t,t}return gL(t,e),Object.defineProperty(t.prototype,"start",{get:function(){return this.open.start},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.close.end},enumerable:!0,configurable:!0}),t}(mL),bL=function(){return function(e,t,n){this.range=e,this.bracket=t,this.bracketType=n}}();function _L(e){var t=new mL;return t.start=e.range.getStartPosition(),t.end=e.range.getEndPosition(),t}var CL=function(){return function(e,t,n){this.lineNumber=n,this.lineText=e.getLineContent(),this.startOffset=e.getStartOffset(t),this.endOffset=e.getEndOffset(t),this.type=e.getStandardTokenType(t),this.languageId=e.getLanguageId(t)}}(),wL=function(){function e(e){this._model=e,this._lineCount=this._model.getLineCount(),this._versionId=this._model.getVersionId(),this._lineNumber=0,this._tokenIndex=0,this._lineTokens=null,this._advance()}return e.prototype._advance=function(){for(this._lineTokens&&(this._tokenIndex++,this._tokenIndex>=this._lineTokens.getCount()&&(this._lineTokens=null));this._lineNumber0)return this._nextBuff.shift();var e=this._rawTokenScanner.next();if(!e)return null;var t=e.lineNumber,n=e.lineText,r=e.type,i=e.startOffset,o=e.endOffset;this._cachedLanguageId!==e.languageId&&(this._cachedLanguageId=e.languageId,this._cachedLanguageBrackets=Zo.getBracketsSupport(this._cachedLanguageId));var s,a=this._cachedLanguageBrackets;if(!a||Do(r))return new bL(new be(t,i+1,t,o+1),0,null);do{if(s=Oo.findNextBracketInToken(a.forwardRegex,t,n,i,o)){var u=s.startColumn-1,l=s.endColumn-1;i=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},SL=function(e,t){return function(n,r){t(n,r,e)}},xL=function(){function e(e){this._modelService=e}return e.prototype.getRangesToPosition=function(e,t){return cn.b.as(this.getRangesToPositionSync(e,t))},e.prototype.getRangesToPositionSync=function(e,t){var n=this._modelService.getModel(e),r=[];return n&&this._doGetRangesToPosition(n,t).forEach(function(e){r.push({type:void 0,range:e})}),r},e.prototype._doGetRangesToPosition=function(e,t){var n,r;n=function e(t,n){if(t instanceof vL&&t.isEmpty)return null;if(!be.containsPosition(t.range,n))return null;var r;if(t instanceof vL){if(t.hasChildren)for(var i=0,o=t.children.length;i=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},IL=function(e,t){return function(n,r){t(n,r,e)}},LL=function(){return function(e){this.editor=e,this.next=null,this.previous=null,this.selection=e.getSelection()}}(),kL=null,TL=!1,FL=function(){function e(e,t){this.editor=e,this._tokenSelectionSupport=t.createInstance(xL)}return e.get=function(t){return t.getContribution(e.ID)},e.prototype.dispose=function(){},e.prototype.getId=function(){return e.ID},e.prototype.run=function(e){var t=this,n=this.editor.getSelection(),r=this.editor.getModel();kL&&kL.editor!==this.editor&&(kL=null);var i=cn.b.as(null);return kL||(i=this._tokenSelectionSupport.getRangesToPosition(r.uri,n.getStartPosition()).then(function(e){if(!Zn(e)){var n;e.filter(function(e){var n=t.editor.getSelection(),r=new be(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);return r.containsPosition(n.getStartPosition())&&r.containsPosition(n.getEndPosition())}).forEach(function(e){var r=e.range,i=new LL(t.editor);i.selection=new be(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn),n&&(i.next=n,n.previous=i),n=i});var r=new LL(t.editor);r.next=n,n&&(n.previous=r),kL=r;var i=t.editor.onDidChangeCursorPosition(function(e){TL||(kL=null,i.dispose())})}})),i.then(function(){if(kL&&(kL=e?kL.next:kL.previous)){TL=!0;try{t.editor.setSelection(kL.selection)}finally{TL=!1}}})},e.ID="editor.contrib.smartSelectController",e=NL([IL(1,Tr)],e)}(),OL=function(e){function t(t,n){var r=e.call(this,n)||this;return r._forward=t,r}return ML(t,e),t.prototype.run=function(e,t){var n=FL.get(t);if(n)return n.run(this._forward)},t}(qu),PL=function(e){function t(){return e.call(this,!0,{id:"editor.action.smartSelect.grow",label:ns("smartSelect.grow","Expand Select"),alias:"Expand Select",precondition:null,kbOpts:{kbExpr:nl.editorTextFocus,primary:1553,mac:{primary:3345}}})||this}return ML(t,e),t}(OL),BL=function(e){function t(){return e.call(this,!1,{id:"editor.action.smartSelect.shrink",label:ns("smartSelect.shrink","Shrink Select"),alias:"Shrink Select",precondition:null,kbOpts:{kbExpr:nl.editorTextFocus,primary:1551,mac:{primary:3343}}})||this}return ML(t,e),t}(OL);el(FL),$u(PL),$u(BL);var RL,jL=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(e){e[e.Dollar=0]="Dollar",e[e.Colon=1]="Colon",e[e.Comma=2]="Comma",e[e.CurlyOpen=3]="CurlyOpen",e[e.CurlyClose=4]="CurlyClose",e[e.Backslash=5]="Backslash",e[e.Forwardslash=6]="Forwardslash",e[e.Pipe=7]="Pipe",e[e.Int=8]="Int",e[e.VariableName=9]="VariableName",e[e.Format=10]="Format",e[e.Plus=11]="Plus",e[e.Dash=12]="Dash",e[e.QuestionMark=13]="QuestionMark",e[e.EOF=14]="EOF"}(RL||(RL={}));var zL=function(){function e(){this.text("")}return e.isDigitCharacter=function(e){return e>=48&&e<=57},e.isVariableCharacter=function(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90},e.prototype.text=function(e){this.value=e,this.pos=0},e.prototype.tokenText=function(e){return this.value.substr(e.pos,e.len)},e.prototype.next=function(){if(this.pos>=this.value.length)return{type:RL.EOF,pos:this.pos,len:0};var t,n=this.pos,r=0,i=this.value.charCodeAt(n);if("number"==typeof(t=e._table[i]))return this.pos+=1,{type:t,pos:n,len:1};if(e.isDigitCharacter(i)){t=RL.Int;do{r+=1,i=this.value.charCodeAt(n+r)}while(e.isDigitCharacter(i));return this.pos+=r,{type:t,pos:n,len:r}}if(e.isVariableCharacter(i)){t=RL.VariableName;do{i=this.value.charCodeAt(n+ ++r)}while(e.isVariableCharacter(i)||e.isDigitCharacter(i));return this.pos+=r,{type:t,pos:n,len:r}}t=RL.Format;do{r+=1,i=this.value.charCodeAt(n+r)}while(!isNaN(i)&&void 0===e._table[i]&&!e.isDigitCharacter(i)&&!e.isVariableCharacter(i));return this.pos+=r,{type:t,pos:n,len:r}},e._table=((qL={})[36]=RL.Dollar,qL[58]=RL.Colon,qL[44]=RL.Comma,qL[123]=RL.CurlyOpen,qL[125]=RL.CurlyClose,qL[92]=RL.Backslash,qL[47]=RL.Forwardslash,qL[124]=RL.Pipe,qL[43]=RL.Plus,qL[45]=RL.Dash,qL[63]=RL.QuestionMark,qL),e}(),WL=function(){function e(){this._children=[]}return e.prototype.appendChild=function(e){return e instanceof VL&&this._children[this._children.length-1]instanceof VL?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this},e.prototype.replace=function(e,t){var n=e.parent,r=n.children.indexOf(e),i=n.children.slice(0);i.splice.apply(i,[r,1].concat(t)),n._children=i,t.forEach(function(e){return e.parent=n})},Object.defineProperty(e.prototype,"children",{get:function(){return this._children},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"snippet",{get:function(){for(var e=this;;){if(!e)return;if(e instanceof JL)return e;e=e.parent}},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.children.reduce(function(e,t){return e+t.toString()},"")},e.prototype.len=function(){return 0},e}(),VL=function(e){function t(t){var n=e.call(this)||this;return n.value=t,n}return jL(t,e),t.escape=function(e){return e.replace(/\$|}|\\/g,"\\$&")},t.prototype.toString=function(){return this.value},t.prototype.toTextmateString=function(){return t.escape(this.value)},t.prototype.len=function(){return this.value.length},t.prototype.clone=function(){return new t(this.value)},t}(WL),HL=function(e){function t(t){var n=e.call(this)||this;return n.index=t,n}return jL(t,e),t.compareByIndex=function(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop?-1:e.indext.index?1:0},Object.defineProperty(t.prototype,"isFinalTabstop",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"choice",{get:function(){return 1===this._children.length&&this._children[0]instanceof UL?this._children[0]:void 0},enumerable:!0,configurable:!0}),t.prototype.toTextmateString=function(){return 0===this.children.length?"$"+this.index:this.choice?"${"+this.index+"|"+this.choice.toTextmateString()+"|}":"${"+this.index+":"+this.children.map(function(e){return e.toTextmateString()}).join("")+"}"},t.prototype.clone=function(){var e=new t(this.index);return e._children=this.children.map(function(e){return e.clone()}),e},t}(WL),UL=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.options=[],t}return jL(t,e),t.prototype.appendChild=function(e){return e instanceof VL&&(e.parent=this,this.options.push(e)),this},t.prototype.toString=function(){return this.options[0].value},t.prototype.toTextmateString=function(){return this.options.map(function(e){return e.value.replace(/\||,/g,"\\$&")}).join(",")},t.prototype.len=function(){return this.options[0].len()},t.prototype.clone=function(){var e=new t;return this.options.forEach(e.appendChild,e),e},t}(WL),YL=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jL(t,e),t.prototype.resolve=function(e){var t=this;return e.replace(this.regexp,function(){for(var e="",n=0,r=t._children;ni.index?arguments[i.index]:"";e+=o=i.resolve(o)}else e+=i.toString()}return e})},t.prototype.toString=function(){return""},t.prototype.toTextmateString=function(){return"/"+VL.escape(this.regexp.source)+"/"+this.children.map(function(e){return e.toTextmateString()})+"/"+(this.regexp.ignoreCase?"i":"")},t.prototype.clone=function(){var e=new t;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(function(e){return e.clone()}),e},t}(WL),ZL=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o.index=t,o.shorthandName=n,o.ifValue=r,o.elseValue=i,o}return jL(t,e),t.prototype.resolve=function(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue},t.prototype.toTextmateString=function(){var e="${";return e+=this.index,this.shorthandName?e+=":/"+this.shorthandName:this.ifValue&&this.elseValue?e+=":?"+this.ifValue+":"+this.elseValue:this.ifValue?e+=":+"+this.ifValue:this.elseValue&&(e+=":-"+this.elseValue),e+="}"},t.prototype.clone=function(){return new t(this.index,this.shorthandName,this.ifValue,this.elseValue)},t}(WL),GL=function(e){function t(t){var n=e.call(this)||this;return n.name=t,n}return jL(t,e),t.prototype.resolve=function(e){var t=e.resolve(this),n=this._children[0];return n instanceof YL&&1===this._children.length&&(t=n.resolve(t||"")),void 0!==t&&(this._children=[new VL(t)],!0)},t.prototype.toTextmateString=function(){return 0===this.children.length?"${"+this.name+"}":"${"+this.name+":"+this.children.map(function(e){return e.toTextmateString()}).join("")+"}"},t.prototype.clone=function(){var e=new t(this.name);return e._children=this.children.map(function(e){return e.clone()}),e},t}(WL);function KL(e,t){for(var n=e.slice();n.length>0;){var r=n.shift();if(!t(r))break;n.unshift.apply(n,r.children)}}var qL,QL,XL,JL=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return jL(t,e),Object.defineProperty(t.prototype,"placeholderInfo",{get:function(){if(!this._placeholders){var e,t=[];this.walk(function(n){return n instanceof HL&&(t.push(n),e=!e||e.index0?i.set(e.index,e.children):o.push(e)),!0});for(var a=0,u=o;a0&&t),!i.has(0)&&n&&r.appendChild(new HL(0)),r},e.prototype._accept=function(e,t){if(void 0===e||this._token.type===e){var n=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),n}return!1},e.prototype._backTo=function(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1},e.prototype._until=function(e){if(this._token.type===RL.EOF)return!1;for(var t=this._token;this._token.type!==e;)this._token=this._scanner.next();var n=this._scanner.value.substring(t.pos,this._token.pos);return this._token=this._scanner.next(),n},e.prototype._parse=function(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)},e.prototype._parseEscaped=function(e){var t;return!!(t=this._accept(RL.Backslash,!0))&&(t=this._accept(RL.Dollar,!0)||this._accept(RL.CurlyClose,!0)||this._accept(RL.Backslash,!0)||t,e.appendChild(new VL(t)),!0)},e.prototype._parseTabstopOrVariableName=function(e){var t,n=this._token;return this._accept(RL.Dollar)&&(t=this._accept(RL.VariableName,!0)||this._accept(RL.Int,!0))?(e.appendChild(/^\d+$/.test(t)?new HL(Number(t)):new GL(t)),!0):this._backTo(n)},e.prototype._parseComplexPlaceholder=function(e){var t,n=this._token;if(!(this._accept(RL.Dollar)&&this._accept(RL.CurlyOpen)&&(t=this._accept(RL.Int,!0))))return this._backTo(n);var r=new HL(Number(t));if(this._accept(RL.Colon))for(;;){if(this._accept(RL.CurlyClose))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new VL("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else{if(!(r.index>0&&this._accept(RL.Pipe)))return this._accept(RL.CurlyClose)?(e.appendChild(r),!0):this._backTo(n);for(var i=new UL;;){if(this._parseChoiceElement(i)){if(this._accept(RL.Comma))continue;if(this._accept(RL.Pipe)&&this._accept(RL.CurlyClose))return r.appendChild(i),e.appendChild(r),!0}return this._backTo(n),!1}}},e.prototype._parseChoiceElement=function(e){for(var t=this._token,n=[];this._token.type!==RL.Comma&&this._token.type!==RL.Pipe;){var r=void 0;if(!(r=(r=this._accept(RL.Backslash,!0))?this._accept(RL.Comma,!0)||this._accept(RL.Pipe,!0)||r:this._accept(void 0,!0)))return this._backTo(t),!1;n.push(r)}return 0===n.length?(this._backTo(t),!1):(e.appendChild(new VL(n.join(""))),!0)},e.prototype._parseComplexVariable=function(e){var t,n=this._token;if(!(this._accept(RL.Dollar)&&this._accept(RL.CurlyOpen)&&(t=this._accept(RL.VariableName,!0))))return this._backTo(n);var r=new GL(t);if(!this._accept(RL.Colon))return this._accept(RL.Forwardslash)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1):this._accept(RL.CurlyClose)?(e.appendChild(r),!0):this._backTo(n);for(;;){if(this._accept(RL.CurlyClose))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new VL("${"+t+":")),r.children.forEach(e.appendChild,e),!0}},e.prototype._parseTransform=function(e){for(var t=new YL,n="",r="";!this._accept(RL.Forwardslash);){var i=void 0;if(i=this._accept(RL.Backslash,!0))n+=i=this._accept(RL.Forwardslash,!0)||i;else{if(this._token.type===RL.EOF)return!1;n+=this._accept(void 0,!0)}}for(;!this._accept(RL.Forwardslash);){i=void 0;if(i=this._accept(RL.Backslash,!0))i=this._accept(RL.Forwardslash,!0)||i,t.appendChild(new VL(i));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(RL.CurlyClose);){if(this._token.type===RL.EOF)return!1;r+=this._accept(void 0,!0)}try{t.regexp=new RegExp(n,r)}catch(e){return!1}return e.appendChild(t),!0},e.prototype._parseFormatString=function(e){var t=this._token;if(!this._accept(RL.Dollar))return!1;var n=!1;this._accept(RL.CurlyOpen)&&(n=!0);var r=this._accept(RL.Int,!0);if(!r)return this._backTo(t),!1;if(!n)return e.appendChild(new ZL(Number(r))),!0;if(this._accept(RL.CurlyClose))return e.appendChild(new ZL(Number(r))),!0;if(!this._accept(RL.Colon))return this._backTo(t),!1;if(this._accept(RL.Forwardslash)){var i=this._accept(RL.VariableName,!0);return i&&this._accept(RL.CurlyClose)?(e.appendChild(new ZL(Number(r),i)),!0):(this._backTo(t),!1)}if(this._accept(RL.Plus)){if(o=this._until(RL.CurlyClose))return e.appendChild(new ZL(Number(r),void 0,o,void 0)),!0}else if(this._accept(RL.Dash)){if(s=this._until(RL.CurlyClose))return e.appendChild(new ZL(Number(r),void 0,void 0,s)),!0}else if(this._accept(RL.QuestionMark)){var o;if(o=this._until(RL.Colon))if(s=this._until(RL.CurlyClose))return e.appendChild(new ZL(Number(r),void 0,o,s)),!0}else{var s;if(s=this._until(RL.CurlyClose))return e.appendChild(new ZL(Number(r),void 0,void 0,s)),!0}return this._backTo(t),!1},e.prototype._parseAnything=function(e){return this._token.type!==RL.EOF&&(e.appendChild(new VL(this._scanner.tokenText(this._token))),this._accept(void 0),!0)},e}(),ek=(n(361),Object.freeze({CURRENT_YEAR:!0,CURRENT_YEAR_SHORT:!0,CURRENT_MONTH:!0,CURRENT_DATE:!0,CURRENT_HOUR:!0,CURRENT_MINUTE:!0,CURRENT_SECOND:!0,CURRENT_DAY_NAME:!0,CURRENT_DAY_NAME_SHORT:!0,CURRENT_MONTH_NAME:!0,CURRENT_MONTH_NAME_SHORT:!0,SELECTION:!0,CLIPBOARD:!0,TM_SELECTED_TEXT:!0,TM_CURRENT_LINE:!0,TM_CURRENT_WORD:!0,TM_LINE_INDEX:!0,TM_LINE_NUMBER:!0,TM_FILENAME:!0,TM_FILENAME_BASE:!0,TM_DIRECTORY:!0,TM_FILEPATH:!0}),function(){function e(e){this._delegates=e}return e.prototype.resolve=function(e){for(var t=0,n=this._delegates;t0&&(this._placeholderGroupsIdx-=1),this._editor.getModel().changeDecorations(function(t){for(var r=new Set,i=[],o=0,s=n._placeholderGroups[n._placeholderGroupsIdx];o0},enumerable:!0,configurable:!0}),e.prototype.computePossibleSelections=function(){for(var e=new Map,t=0,n=this._placeholderGroups;t ")+'"'},e.prototype.insert=function(){var t=this,n=this._editor.getModel(),r=e.createEditsAndSnippets(this._editor,this._template,this._overwriteBefore,this._overwriteAfter,!1),i=r.edits,o=r.snippets;this._snippets=o;var s=n.pushEditOperations(this._editor.getSelections(),i,function(e){return t._snippets[0].hasPlaceholder?t._move(!0):e.map(function(e){return Ii.fromPositions(e.range.getEndPosition())})});this._editor.setSelections(s),this._editor.revealRange(s[0])},e.prototype.merge=function(t,n,r){var i=this;void 0===n&&(n=0),void 0===r&&(r=0),this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,t]);var o=e.createEditsAndSnippets(this._editor,t,n,r,!0),s=o.edits,a=o.snippets;this._editor.setSelections(this._editor.getModel().pushEditOperations(this._editor.getSelections(),s,function(e){for(var t=0,n=i._snippets;t0},e.prototype.getEnclosingRange=function(){for(var e,t=0,n=this._snippets;t=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},Dk=function(e,t){return function(n,r){t(n,r,e)}},Ek=function(){function e(t,n,r){this._editor=t,this._logService=n,this._snippetListener=[],this._inSnippet=e.InSnippetMode.bindTo(r),this._hasNextTabstop=e.HasNextTabstop.bindTo(r),this._hasPrevTabstop=e.HasPrevTabstop.bindTo(r)}return e.get=function(e){return e.getContribution("snippetController2")},e.prototype.dispose=function(){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),on(this._session)},e.prototype.getId=function(){return"snippetController2"},e.prototype.insert=function(e,t,n,r,i){void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=!0),void 0===i&&(i=!0);try{this._doInsert(e,t,n,r,i)}catch(t){this.cancel(),this._logService.error(t),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}},e.prototype._doInsert=function(e,t,n,r,i){var o=this;void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=!0),void 0===i&&(i=!0),this._snippetListener=on(this._snippetListener),r&&this._editor.getModel().pushStackElement(),this._session?this._session.merge(e,t,n):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new sk(this._editor,e,t,n),this._session.insert()),i&&this._editor.getModel().pushStackElement(),this._updateState(),this._snippetListener=[this._editor.onDidChangeModelContent(function(e){return e.isFlush&&o.cancel()}),this._editor.onDidChangeModel(function(){return o.cancel()}),this._editor.onDidChangeCursorSelection(function(){return o._updateState()})]},e.prototype._updateState=function(){if(this._session){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}},e.prototype._handleChoice=function(){var e,t,n=this._session.choice;if(n){if(this._currentChoice!==n){this._currentChoice=n,this._editor.setSelections(this._editor.getSelections().map(function(e){return Ii.fromPositions(e.getStartPosition())}));var r=n.options[0];e=this._editor,t=n.options.map(function(e,t){return{type:"value",label:e.value,insertText:e.value,sortText:$t("a",t),overwriteAfter:r.value.length}}),setTimeout(function(){XL=t,e.getContribution("editor.contrib.suggestController").triggerSuggest([gk]),XL=void 0},0)}}else this._currentChoice=void 0},e.prototype.finish=function(){for(;this._inSnippet.get();)this.next()},e.prototype.cancel=function(){this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),on(this._snippetListener),on(this._session),this._session=void 0,this._modelVersionId=-1},e.prototype.prev=function(){this._session.prev(),this._updateState()},e.prototype.next=function(){this._session.next(),this._updateState()},e.prototype.getSessionEnclosingRange=function(){if(this._session)return this._session.getEnclosingRange()},e.InSnippetMode=new Au("inSnippetMode",!1),e.HasNextTabstop=new Au("hasNextTabstop",!1),e.HasPrevTabstop=new Au("hasPrevTabstop",!1),e=wk([Dk(1,yk),Dk(2,Su)],e)}();el(Ek);var Ak=Ku.bindToContribution(Ek.get);function Sk(){for(var e=[],t=0;t0?[{start:0,end:t.length}]:[]:null}function Nk(e){return 97<=e&&e<=122}function Ik(e){return 65<=e&&e<=90}function Lk(e){return 48<=e&&e<=57}function kk(e){return 32===e||9===e||10===e||13===e}function Tk(e){return Nk(e)||Ik(e)||Lk(e)}function Fk(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function Ok(e,t){for(var n=t;n0&&!Tk(e.charCodeAt(n-1)))return n}return e.length}function Pk(e,t,n,r){if(n===e.length)return[];if(r===t.length)return null;if(e[n]!==t[r].toLowerCase())return null;var i=null,o=r+1;for(i=Pk(e,t,n+1,r+1);!i&&(o=Ok(t,o))60)return null;var n=function(e){for(var t=0,n=0,r=0,i=0,o=0,s=0;s.2&&t<.8&&r>.6&&i<.2}(n)){if(!function(e){var t=e.upperPercent;return 0===e.lowerPercent&&t>.6}(n))return null;t=t.toLowerCase()}for(var r=null,i=0;i=0&&(r.push(s),i=s+1)}return[r.length,r]}function jk(){for(var e=[],t=[0],n=1;n<=100;n++)t.push(-n);for(n=0;n<=100;n++){var r=t.slice(0);r[0]=-n,e.push(r)}return e}var zk=jk(),Wk=jk(),Vk=jk(),Hk=!1;function Uk(e,t,n,r,i){function o(e,t,n){for(void 0===n&&(n=" ");e.length=e.length)return!1;switch(e.charCodeAt(t)){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:return!0;default:return!1}}function Zk(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function Gk(e,t,n){var r=e.length>100?100:e.length,i=t.length>100?100:t.length,o=0;for(void 0===n&&(n=r);oi)){for(var s=e.toLowerCase(),a=t.toLowerCase(),u=o,l=0;u1?1:c),p=zk[u-1][l]+-1,f=zk[u][l-1]+-1;f>=p?f>d?(zk[u][l]=f,Vk[u][l]=4):f===d?(zk[u][l]=f,Vk[u][l]=6):(zk[u][l]=d,Vk[u][l]=2):p>d?(zk[u][l]=p,Vk[u][l]=1):p===d?(zk[u][l]=p,Vk[u][l]=3):(zk[u][l]=d,Vk[u][l]=2)}if(Hk&&(console.log(Uk(zk,e,r,t,i)),console.log(Uk(Vk,e,r,t,i)),console.log(Uk(Wk,e,r,t,i))),qk=0,Qk=-100,Xk=o,function e(t,n,r,i,o){if(qk>=10||r<-25)return;var s=0;for(;t>Xk&&n>0;){var a=Wk[t][n],u=Vk[t][n];if(4===u)n-=1,o?r-=5:i.isEmpty()||(r-=1),o=!1,s=0;else{if(!(2&u))return;if(4&u&&e(t,n-1,i.isEmpty()?r:r-1,i.slice(),o),r+=a,t-=1,n-=1,i.unshift(n),o=!0,1===a){if(s+=1,t===Xk)return}else r+=1+s*(a-1),s=0}}r-=n>=3?9:3*n;qk+=1;r>Qk&&(Qk=r,Kk=i)}(r,i,r===i?1:0,new Jk,!1),0!==qk)return[Qk,Kk.toArray()]}}}var Kk,qk=0,Qk=0,Xk=0;var Jk=function(){function e(){}return e.prototype.isEmpty=function(){return!this._data&&(!this._parent||this._parent.isEmpty())},e.prototype.unshift=function(e){this._data?this._data.unshift(e):this._data=[e]},e.prototype.slice=function(){var t=new e;return t._parent=this,t._parentLen=this._data?this._data.length:0,t},e.prototype.toArray=function(){if(!this._data)return this._parent.toArray();for(var e=[],t=this;t;)t._parent&&t._parent._data&&e.push(t._parent._data.slice(t._parent._data.length-t._parentLen)),t=t._parent;return Array.prototype.concat.apply(this._data,e)},e}();function $k(e,t,n){return eT(e,t,!0,n)}function eT(e,t,n,r){var i=Gk(e,t,r);if(i&&!n)return i;if(e.length>=3)for(var o=Math.min(7,e.length-1),s=1;si[0])&&(i=u))}}return i}function tT(e,t){if(!(t+1>=e.length)){var n=e[t],r=e[t+1];if(n!==r)return e.slice(0,t)+r+n+e.slice(t+2)}}var nT=function(){function e(t,n,r,i){this._snippetCompareFn=e._compareCompletionItems,this._items=t,this._column=n,this._refilterKind=1,this._lineContext=r,"top"===i?this._snippetCompareFn=e._compareCompletionItemsSnippetsUp:"bottom"===i&&(this._snippetCompareFn=e._compareCompletionItemsSnippetsDown)}return e.prototype.dispose=function(){for(var e,t=new Set,n=0,r=this._items;n2e3?Gk:$k,a=0;at.score?-1:e.scoret.idx?1:0},e._compareCompletionItemsSnippetsDown=function(t,n){if(t.suggestion.type!==n.suggestion.type){if("snippet"===t.suggestion.type)return 1;if("snippet"===n.suggestion.type)return-1}return e._compareCompletionItems(t,n)},e._compareCompletionItemsSnippetsUp=function(t,n){if(t.suggestion.type!==n.suggestion.type){if("snippet"===t.suggestion.type)return-1;if("snippet"===n.suggestion.type)return 1}return e._compareCompletionItems(t,n)},e}(),rT=function(){function e(e,t,n){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.auto=n}return e.shouldAutoTrigger=function(e){var t=e.getModel();if(!t)return!1;var n=e.getPosition();t.tokenizeIfCheap(n.lineNumber);var r=t.getWordAtPosition(n);return!!r&&(r.endColumn===n.column&&!!isNaN(Number(r.word)))},e}(),iT=function(){function e(e){var t=this;this._toDispose=[],this._triggerRefilter=new Hl,this._onDidCancel=new wn,this._onDidTrigger=new wn,this._onDidSuggest=new wn,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._editor=e,this._state=0,this._triggerAutoSuggestPromise=null,this._requestPromise=null,this._completionModel=null,this._context=null,this._currentSelection=this._editor.getSelection()||new Ii(1,1,1,1),this._toDispose.push(this._editor.onDidChangeModel(function(){t._updateTriggerCharacters(),t.cancel()})),this._toDispose.push(this._editor.onDidChangeModelLanguage(function(){t._updateTriggerCharacters(),t.cancel()})),this._toDispose.push(this._editor.onDidChangeConfiguration(function(){t._updateTriggerCharacters(),t._updateQuickSuggest()})),this._toDispose.push(hi.onDidChange(function(){t._updateTriggerCharacters(),t._updateActiveSuggestSession()})),this._toDispose.push(this._editor.onDidChangeCursorSelection(function(e){t._onCursorChange(e)})),this._toDispose.push(this._editor.onDidChangeModelContent(function(e){t._refilterCompletionItems()})),this._updateTriggerCharacters(),this._updateQuickSuggest()}return e.prototype.dispose=function(){on([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerCharacterListener,this._triggerRefilter]),this._toDispose=on(this._toDispose),on(this._completionModel),this.cancel()},e.prototype._updateQuickSuggest=function(){this._quickSuggestDelay=this._editor.getConfiguration().contribInfo.quickSuggestionsDelay,(isNaN(this._quickSuggestDelay)||!this._quickSuggestDelay&&0!==this._quickSuggestDelay||this._quickSuggestDelay<0)&&(this._quickSuggestDelay=10)},e.prototype._updateTriggerCharacters=function(){var e=this;if(on(this._triggerCharacterListener),!this._editor.getConfiguration().readOnly&&this._editor.getModel()&&this._editor.getConfiguration().contribInfo.suggestOnTriggerCharacters){for(var t=Object.create(null),n=0,r=hi.all(this._editor.getModel());nthis._context.column&&this._completionModel.incomplete&&0!==e.leadingWord.word.length){var t=this._completionModel.resolveIncompleteInfo(),n=t.complete,r=t.incomplete;this.trigger({auto:2===this._state},!0,r,n)}else{var i=this._completionModel.lineContext,o=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){if(rT.shouldAutoTrigger(this._editor)&&this._context.leadingWord.endColumn0)&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,auto:this._context.auto,isFrozen:o})}}else this.cancel()},e}(),oT=(n(362),Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},aT=function(e,t){return function(n,r){t(n,r,e)}},uT=!1,lT=lf("editorSuggestWidget.background",{dark:Xf,light:Xf,hc:Xf},ns("editorSuggestWidgetBackground","Background color of the suggest widget.")),cT=lf("editorSuggestWidget.border",{dark:Jf,light:Jf,hc:Jf},ns("editorSuggestWidgetBorder","Border color of the suggest widget.")),hT=lf("editorSuggestWidget.foreground",{dark:Qf,light:Qf,hc:Qf},ns("editorSuggestWidgetForeground","Foreground color of the suggest widget.")),dT=lf("editorSuggestWidget.selectedBackground",{dark:Lf,light:Lf,hc:Lf},ns("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget.")),pT=lf("editorSuggestWidget.highlightForeground",{dark:Wf,light:Wf,hc:Wf},ns("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget.")),fT=/^(#([\da-f]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))$/i;function gT(e){return e&&e.match(fT)?e:null}function mT(e){if(!e)return!1;var t=e.suggestion;return!!t.documentation||t.detail&&t.detail!==t.label}var vT=function(){function e(e,t,n){this.widget=e,this.editor=t,this.triggerKeybindingLabel=n}return Object.defineProperty(e.prototype,"templateId",{get:function(){return"suggestion"},enumerable:!0,configurable:!0}),e.prototype.renderTemplate=function(e){var t=this,n=Object.create(null);n.disposables=[],n.root=e,n.icon=vh(e,bh(".icon")),n.colorspan=vh(n.icon,bh("span.colorspan"));var r=vh(vh(e,bh(".contents")),bh(".main"));n.highlightedLabel=new gM(r),n.disposables.push(n.highlightedLabel),n.typeLabel=vh(r,bh("span.type-label")),n.readMore=vh(r,bh("span.readMore")),n.readMore.title=ns("readMore","Read More...{0}",this.triggerKeybindingLabel);var i=function(){var e=t.editor.getConfiguration(),i=e.fontInfo.fontFamily,o=(e.contribInfo.suggestFontSize||e.fontInfo.fontSize)+"px",s=(e.contribInfo.suggestLineHeight||e.fontInfo.lineHeight)+"px";n.root.style.fontSize=o,r.style.fontFamily=i,r.style.lineHeight=s,n.icon.style.height=s,n.icon.style.width=s,n.readMore.style.height=s,n.readMore.style.width=s};return i(),In(this.editor.onDidChangeConfiguration.bind(this.editor)).filter(function(e){return e.fontInfo||e.contribInfo}).on(i,null,n.disposables),n},e.prototype.renderElement=function(e,t,n){var r=this,i=n,o=e.suggestion;if(mT(e)?i.root.setAttribute("aria-label",ns("suggestionWithDetailsAriaLabel","{0}, suggestion, has details",o.label)):i.root.setAttribute("aria-label",ns("suggestionAriaLabel","{0}, suggestion",o.label)),i.icon.className="icon "+o.type,i.colorspan.style.backgroundColor="","color"===o.type){var s=gT(o.label)||"string"==typeof o.documentation&&gT(o.documentation);s&&(i.icon.className="icon customcolor",i.colorspan.style.backgroundColor=s)}i.highlightedLabel.set(o.label,function(e){var t,n=[];if(!e)return n;for(var r=0,i=e;r1),o)r?this.setState(0):this.setState(2),this.completionModel=null;else{var s=this.completionModel.stats;s.wasAutomaticallyTriggered=!!r,this.telemetryService.publicLog("suggestWidget",oT({},s,this.editor.getTelemetryData())),this.focusedItem=null,this.list.splice(0,this.list.length,this.completionModel.items),n?this.setState(4):this.setState(3),this.list.reveal(t,t),this.list.setFocus([t]),this.detailsBorderColor&&(this.details.element.style.borderColor=this.detailsBorderColor)}}},e.prototype.selectNextPage=function(){switch(this.state){case 0:return!1;case 5:return this.details.pageDown(),!0;case 1:return!this.isAuto;default:return this.list.focusNextPage(),!0}},e.prototype.selectNext=function(){switch(this.state){case 0:return!1;case 1:return!this.isAuto;default:return this.list.focusNext(1,!0),!0}},e.prototype.selectLast=function(){switch(this.state){case 0:return!1;case 5:return this.details.scrollBottom(),!0;case 1:return!this.isAuto;default:return this.list.focusLast(),!0}},e.prototype.selectPreviousPage=function(){switch(this.state){case 0:return!1;case 5:return this.details.pageUp(),!0;case 1:return!this.isAuto;default:return this.list.focusPreviousPage(),!0}},e.prototype.selectPrevious=function(){switch(this.state){case 0:return!1;case 1:return!this.isAuto;default:return this.list.focusPrevious(1,!0),!1}},e.prototype.selectFirst=function(){switch(this.state){case 0:return!1;case 5:return this.details.scrollTop(),!0;case 1:return!this.isAuto;default:return this.list.focusFirst(),!0}},e.prototype.getFocusedItem=function(){if(0!==this.state&&2!==this.state&&1!==this.state)return{item:this.list.getFocusedElements()[0],index:this.list.getFocus()[0],model:this.completionModel}},e.prototype.toggleDetailsFocus=function(){5===this.state?(this.setState(3),this.detailsBorderColor&&(this.details.element.style.borderColor=this.detailsBorderColor)):3===this.state&&this.expandDocsSettingFromStorage()&&(this.setState(5),this.detailsFocusBorderColor&&(this.details.element.style.borderColor=this.detailsFocusBorderColor)),this.telemetryService.publicLog("suggestWidget:toggleDetailsFocus",this.editor.getTelemetryData())},e.prototype.toggleDetails=function(){if(mT(this.list.getFocusedElements()[0]))if(this.expandDocsSettingFromStorage())this.updateExpandDocsSetting(!1),Ch(this.details.element),Nc(this.element,"docs-side"),Nc(this.element,"docs-below"),this.editor.layoutContentWidget(this),this.telemetryService.publicLog("suggestWidget:collapseDetails",this.editor.getTelemetryData());else{if(3!==this.state&&5!==this.state)return;this.updateExpandDocsSetting(!0),this.showDetails(),this.telemetryService.publicLog("suggestWidget:expandDetails",this.editor.getTelemetryData())}},e.prototype.showDetails=function(){this.expandSideOrBelow(),_h(this.details.element),this.details.render(this.list.getFocusedElements()[0]),this.details.element.style.maxHeight=this.maxWidgetHeight+"px",this.listElement.style.marginTop="0px",this.editor.layoutContentWidget(this),this.adjustDocsPosition(),this.editor.focus(),this._ariaAlert(this.details.getAriaLabel())},e.prototype.show=function(){var e=this,t=this.updateListHeight();t!==this.listHeight&&(this.editor.layoutContentWidget(this),this.listHeight=t),this.suggestWidgetVisible.set(!0),this.showTimeout=cn.b.timeout(100).then(function(){Mc(e.element,"visible"),e.onDidShowEmitter.fire(e)})},e.prototype.hide=function(){this.suggestWidgetVisible.reset(),this.suggestWidgetMultipleSuggestions.reset(),Nc(this.element,"visible")},e.prototype.hideWidget=function(){clearTimeout(this.loadingTimeout),this.setState(0),this.onDidHideEmitter.fire(this)},e.prototype.getPosition=function(){return 0===this.state?null:{position:this.editor.getPosition(),preference:[Bu.BELOW,Bu.ABOVE]}},e.prototype.getDomNode=function(){return this.element},e.prototype.getId=function(){return e.ID},e.prototype.updateListHeight=function(){var e=0;if(2===this.state||1===this.state)e=this.unfocusedHeight;else{var t=this.list.contentHeight/this.unfocusedHeight;e=Math.min(t,12)*this.unfocusedHeight}return this.element.style.lineHeight=this.unfocusedHeight+"px",this.listElement.style.height=e+"px",this.list.layout(e),e},e.prototype.adjustDocsPosition=function(){var e=this.editor.getConfiguration().fontInfo.lineHeight,t=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),n=eh(this.editor.getDomNode()),r=n.left+t.left,i=n.top+t.top+t.height,o=eh(this.element),s=o.left,a=o.top;sa&&this.details.element.offsetHeight>this.listElement.offsetHeight&&(this.listElement.style.marginTop=this.details.element.offsetHeight-this.listElement.offsetHeight+"px")},e.prototype.expandSideOrBelow=function(){var e=this.element.style.maxWidth.match(/(\d+)px/);!e||Number(e[1])=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},wT=function(e,t){return function(n,r){t(n,r,e)}},DT=function(){return function(){}}(),ET=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _T(t,e),t.prototype.memorize=function(e,t,n){},t.prototype.select=function(e,t,n){return 0},t.prototype.toJSON=function(){},t.prototype.fromJSON=function(){},t}(DT),AT=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._cache=new Ke(300,.66),t._seq=0,t}return _T(t,e),t.prototype.memorize=function(e,t,n){var r=n.suggestion.label,i=e.getLanguageIdentifier().language+"/"+r;this._cache.set(i,{touch:this._seq++,type:n.suggestion.type,insertText:n.suggestion.insertText})},t.prototype.select=function(e,t,n){if(0!==e.getWordUntilPosition(t).word.length)return 0;var r=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(r))return 0;for(var i=0,o=-1,s=0;so&&l.type===a.type&&l.insertText===a.insertText&&(o=l.touch,i=s)}return i},t.prototype.toJSON=function(){var e=[];return this._cache.forEach(function(t,n){e.push([n,t])}),e},t.prototype.fromJSON=function(e){this._cache.clear();for(var t=0,n=e;t0){this._seq=e[0][1].touch+1;for(var t=0,n=e;t=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},IT=function(e,t){return function(n,r){t(n,r,e)}},LT=function(){function e(e,t,n){var r=this;this._disposables=[],this._activeAcceptCharacters=new Set,this._disposables.push(t.onDidShow(function(){return r._onItem(t.getFocusedItem())})),this._disposables.push(t.onDidFocus(this._onItem,this)),this._disposables.push(t.onDidHide(this.reset,this)),this._disposables.push(e.onWillType(function(t){if(r._activeItem){var i=t[t.length-1];r._activeAcceptCharacters.has(i)&&e.getConfiguration().contribInfo.acceptSuggestionOnCommitCharacter&&n(r._activeItem)}}))}return e.prototype._onItem=function(e){if(e&&!Zn(e.item.suggestion.commitCharacters)){this._activeItem=e,this._activeAcceptCharacters.clear();for(var t=0,n=e.item.suggestion.commitCharacters;t0&&this._activeAcceptCharacters.add(r[0])}}else this.reset()},e.prototype.reset=function(){this._activeItem=void 0},e.prototype.dispose=function(){on(this._disposables)},e}(),kT=function(){function e(e,t,n,r){var i=this;this._editor=e,this._commandService=t,this._contextKeyService=n,this._instantiationService=r,this._toDispose=[],this._model=new iT(this._editor),this._memory=r.createInstance(xT,this._editor.getConfiguration().contribInfo.suggestSelection),this._toDispose.push(this._model.onDidTrigger(function(e){i._widget||i._createSuggestWidget(),i._widget.showTriggered(e.auto)})),this._toDispose.push(this._model.onDidSuggest(function(e){var t=i._memory.select(i._editor.getModel(),i._editor.getPosition(),e.completionModel.items);i._widget.showSuggestions(e.completionModel,t,e.isFrozen,e.auto)})),this._toDispose.push(this._model.onDidCancel(function(e){i._widget&&!e.retrigger&&i._widget.hideWidget()}));var o=ak.AcceptSuggestionsOnEnter.bindTo(n),s=function(){var e=i._editor.getConfiguration().contribInfo,t=e.acceptSuggestionOnEnter,n=e.suggestSelection;o.set("on"===t||"smart"===t),i._memory.setMode(n)};this._toDispose.push(this._editor.onDidChangeConfiguration(function(e){return s()})),s()}return e.get=function(t){return t.getContribution(e.ID)},e.prototype._createSuggestWidget=function(){var e=this;this._widget=this._instantiationService.createInstance(bT,this._editor),this._toDispose.push(this._widget.onDidSelect(this._onDidSelectItem,this));var t=new LT(this._editor,this._widget,function(t){return e._onDidSelectItem(t)});this._toDispose.push(t,this._model.onDidSuggest(function(e){0===e.completionModel.items.length&&t.reset()}));var n=ak.MakesTextEdit.bindTo(this._contextKeyService);this._toDispose.push(this._widget.onDidFocus(function(t){var r=t.item,i=e._editor.getPosition(),o=r.position.column-r.suggestion.overwriteBefore,s=i.column,a=!0;"smart"!==e._editor.getConfiguration().contribInfo.acceptSuggestionOnEnter||2!==e._model.state||r.suggestion.command||r.suggestion.additionalTextEdits||"textmate"===r.suggestion.snippetType||s-o!==r.suggestion.insertText.length||(a=e._editor.getModel().getValueInRange({startLineNumber:i.lineNumber,startColumn:o,endLineNumber:i.lineNumber,endColumn:s})!==r.suggestion.insertText);n.set(a)})),this._toDispose.push({dispose:function(){n.reset()}})},e.prototype.getId=function(){return e.ID},e.prototype.dispose=function(){this._toDispose=on(this._toDispose),this._widget&&(this._widget.dispose(),this._widget=null),this._model&&(this._model.dispose(),this._model=null)},e.prototype._onDidSelectItem=function(e){if(e&&e.item){var t=e.item,n=t.suggestion,r=t.position,i=this._editor.getPosition().column-r.column;Array.isArray(n.additionalTextEdits)&&(this._editor.pushUndoStop(),this._editor.executeEdits("suggestController.additionalTextEdits",n.additionalTextEdits.map(function(e){return S_.replace(be.lift(e.range),e.text)})),this._editor.pushUndoStop()),this._memory.memorize(this._editor.getModel(),this._editor.getPosition(),e.item);var o,s=n.insertText;"textmate"!==n.snippetType&&(s=$L.escape(s)),Ek.get(this._editor).insert(s,n.overwriteBefore+i,n.overwriteAfter),n.command?n.command.id===TT.id?this._model.trigger({auto:!0},!0):((o=this._commandService).executeCommand.apply(o,[n.command.id].concat(n.command.arguments)).done(void 0,pn),this._model.cancel()):this._model.cancel(),this._alertCompletionItem(e.item)}else this._model.cancel()},e.prototype._alertCompletionItem=function(e){var t=e.suggestion;Vw(ns("arai.alert.snippet","Accepting '{0}' did insert the following text: {1}",t.label,t.insertText))},e.prototype.triggerSuggest=function(e){this._model.trigger({auto:!1},!1,e),this._editor.revealLine(this._editor.getPosition().lineNumber,0),this._editor.focus()},e.prototype.acceptSelectedSuggestion=function(){if(this._widget){var e=this._widget.getFocusedItem();this._onDidSelectItem(e)}},e.prototype.cancelSuggestWidget=function(){this._widget&&(this._model.cancel(),this._widget.hideWidget())},e.prototype.selectNextSuggestion=function(){this._widget&&this._widget.selectNext()},e.prototype.selectNextPageSuggestion=function(){this._widget&&this._widget.selectNextPage()},e.prototype.selectLastSuggestion=function(){this._widget&&this._widget.selectLast()},e.prototype.selectPrevSuggestion=function(){this._widget&&this._widget.selectPrevious()},e.prototype.selectPrevPageSuggestion=function(){this._widget&&this._widget.selectPreviousPage()},e.prototype.selectFirstSuggestion=function(){this._widget&&this._widget.selectFirst()},e.prototype.toggleSuggestionDetails=function(){this._widget&&this._widget.toggleDetails()},e.prototype.toggleSuggestionFocus=function(){this._widget&&this._widget.toggleDetailsFocus()},e.ID="editor.contrib.suggestController",e=NT([IT(1,Za),IT(2,Su),IT(3,Tr)],e)}(),TT=function(e){function t(){return e.call(this,{id:t.id,label:ns("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:mu.and(nl.writable,nl.hasCompletionItemProvider),kbOpts:{kbExpr:nl.textInputFocus,primary:2058,mac:{primary:266}}})||this}return MT(t,e),t.prototype.run=function(e,t){var n=kT.get(t);n&&n.triggerSuggest()},t.id="editor.action.triggerSuggest",t}(qu);el(kT),$u(TT);var FT=au.WEIGHT.editorContrib(90),OT=Ku.bindToContribution(kT.get);Ju(new OT({id:"acceptSelectedSuggestion",precondition:ak.Visible,handler:function(e){return e.acceptSelectedSuggestion()},kbOpts:{weight:FT,kbExpr:nl.textInputFocus,primary:2}})),Ju(new OT({id:"acceptSelectedSuggestionOnEnter",precondition:ak.Visible,handler:function(e){return e.acceptSelectedSuggestion()},kbOpts:{weight:FT,kbExpr:mu.and(nl.textInputFocus,ak.AcceptSuggestionsOnEnter,ak.MakesTextEdit),primary:3}})),Ju(new OT({id:"hideSuggestWidget",precondition:ak.Visible,handler:function(e){return e.cancelSuggestWidget()},kbOpts:{weight:FT,kbExpr:nl.textInputFocus,primary:9,secondary:[1033]}})),Ju(new OT({id:"selectNextSuggestion",precondition:mu.and(ak.Visible,ak.MultipleSuggestions),handler:function(e){return e.selectNextSuggestion()},kbOpts:{weight:FT,kbExpr:nl.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),Ju(new OT({id:"selectNextPageSuggestion",precondition:mu.and(ak.Visible,ak.MultipleSuggestions),handler:function(e){return e.selectNextPageSuggestion()},kbOpts:{weight:FT,kbExpr:nl.textInputFocus,primary:12,secondary:[2060]}})),Ju(new OT({id:"selectLastSuggestion",precondition:mu.and(ak.Visible,ak.MultipleSuggestions),handler:function(e){return e.selectLastSuggestion()}})),Ju(new OT({id:"selectPrevSuggestion",precondition:mu.and(ak.Visible,ak.MultipleSuggestions),handler:function(e){return e.selectPrevSuggestion()},kbOpts:{weight:FT,kbExpr:nl.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),Ju(new OT({id:"selectPrevPageSuggestion",precondition:mu.and(ak.Visible,ak.MultipleSuggestions),handler:function(e){return e.selectPrevPageSuggestion()},kbOpts:{weight:FT,kbExpr:nl.textInputFocus,primary:11,secondary:[2059]}})),Ju(new OT({id:"selectFirstSuggestion",precondition:mu.and(ak.Visible,ak.MultipleSuggestions),handler:function(e){return e.selectFirstSuggestion()}})),Ju(new OT({id:"toggleSuggestionDetails",precondition:ak.Visible,handler:function(e){return e.toggleSuggestionDetails()},kbOpts:{weight:FT,kbExpr:nl.textInputFocus,primary:2058,mac:{primary:266}}})),Ju(new OT({id:"toggleSuggestionFocus",precondition:ak.Visible,handler:function(e){return e.toggleSuggestionFocus()},kbOpts:{weight:FT,kbExpr:nl.textInputFocus,primary:2570,mac:{primary:778}}}));var PT=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();$u(function(e){function t(){return e.call(this,{id:t.ID,label:ns({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),alias:"Toggle Tab Key Moves Focus",precondition:null,kbOpts:{kbExpr:null,primary:2091,mac:{primary:1323}}})||this}return PT(t,e),t.prototype.run=function(e,t){var n=Mp.getTabFocusMode();Mp.setTabFocusMode(!n)},t.ID="editor.action.toggleTabFocusMode",t}(qu));var BT=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),RT=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},jT=function(e,t){return function(n,r){t(n,r,e)}},zT=lf("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hc:null},ns("wordHighlight","Background color of a symbol during read-access, like reading a variable. The color must not be opaque to not hide underlying decorations."),!0),WT=lf("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hc:null},ns("wordHighlightStrong","Background color of a symbol during write-access, like writing to a variable. The color must not be opaque to not hide underlying decorations."),!0),VT=lf("editor.wordHighlightBorder",{light:null,dark:null,hc:mf},ns("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable.")),HT=lf("editor.wordHighlightStrongBorder",{light:null,dark:null,hc:mf},ns("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable.")),UT=lf("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},ns("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque to not hide underlying decorations."),!0),YT=lf("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hc:"#C0A0C0CC"},ns("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque to not hide underlying decorations."),!0),ZT=new Au("hasWordHighlights",!1);function GT(e,t){var n=!1;return Wl(gi.ordered(e).map(function(r){return function(){if(!n)return Pl(function(n){return r.provideDocumentHighlights(e,t,n)}).then(function(e){if(Array.isArray(e)&&e.length>0)return n=!0,e},function(e){fn(e)})}})).then(function(e){return e[0]})}Xu("_executeDocumentHighlights",GT);var KT=function(){function e(e,t){var n=this;this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this._hasWordHighlights=ZT.bindTo(t),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getConfiguration().contribInfo.occurrencesHighlight,this.model=this.editor.getModel(),this.toUnhook=[],this.toUnhook.push(e.onDidChangeCursorPosition(function(e){n._ignorePositionChangeEvent||n.occurrencesHighlight&&n._onPositionChanged(e)})),this.toUnhook.push(e.onDidChangeModel(function(e){n._stopAll(),n.model=n.editor.getModel()})),this.toUnhook.push(e.onDidChangeModelContent(function(e){n._stopAll()})),this.toUnhook.push(e.onDidChangeConfiguration(function(e){var t=n.editor.getConfiguration().contribInfo.occurrencesHighlight;n.occurrencesHighlight!==t&&(n.occurrencesHighlight=t,n._stopAll())})),this._lastWordRange=null,this._decorationIds=[],this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}return e.prototype.hasDecorations=function(){return this._decorationIds.length>0},e.prototype.restore=function(){this.occurrencesHighlight&&this._run()},e.prototype._getSortedHighlights=function(){var e=this;return this._decorationIds.map(function(t){return e.model.getDecorationRange(t)}).sort(be.compareRangesUsingStarts)},e.prototype.moveNext=function(){var e=this,t=this._getSortedHighlights(),n=t[(Kn(t,function(t){return t.containsPosition(e.editor.getPosition())})+1)%t.length];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n)}finally{this._ignorePositionChangeEvent=!1}},e.prototype.moveBack=function(){var e=this,t=this._getSortedHighlights(),n=t[(Kn(t,function(t){return t.containsPosition(e.editor.getPosition())})-1+t.length)%t.length];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n)}finally{this._ignorePositionChangeEvent=!1}},e.prototype._removeDecorations=function(){this._decorationIds.length>0&&(this._decorationIds=this.editor.deltaDecorations(this._decorationIds,[]),this._hasWordHighlights.set(!1))},e.prototype._stopAll=function(){this._lastWordRange=null,this._removeDecorations(),-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)},e.prototype._onPositionChanged=function(e){this.occurrencesHighlight&&e.reason===La.Explicit?this._run():this._stopAll()},e.prototype._run=function(){var e=this;if(gi.has(this.model)){var t=this.editor.getSelection();if(t.startLineNumber===t.endLineNumber){var n=t.startLineNumber,r=t.startColumn,i=t.endColumn,o=this.model.getWordAtPosition({lineNumber:n,column:r});if(!o||o.startColumn>r||o.endColumn=i&&(a=!0)}if(this.lastCursorPositionChangeTime=(new Date).getTime(),a)this.workerRequestCompleted&&-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();var h=++this.workerRequestTokenId;this.workerRequestCompleted=!1,this.workerRequest=GT(this.model,this.editor.getPosition()),this.workerRequest.then(function(t){h===e.workerRequestTokenId&&(e.workerRequestCompleted=!0,e.workerRequestValue=t||[],e._beginRenderDecorations())}).done()}this._lastWordRange=s}}else this._stopAll()}else this._stopAll()},e.prototype._beginRenderDecorations=function(){var e=this,t=(new Date).getTime(),n=this.lastCursorPositionChangeTime+250;t>=n?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(function(){e.renderDecorations()},n-t)},e.prototype.renderDecorations=function(){this.renderDecorationsTimer=-1;for(var t=[],n=0,r=this.workerRequestValue.length;n=93&&e<=108)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Ya.toString(e)},t.prototype._getElectronAcceleratorLabelForKeybinding=function(e){return e?e.isDuplicateModifierCase()?null:this._keyCodeToElectronAccelerator(e.keyCode):null},t.prototype.getElectronAccelerator=function(){if(null!==this._chordPart)return null;var e=this._getElectronAcceleratorLabelForKeybinding(this._firstPart);return TF.toLabel(this._firstPart,e,null,null,this._os)},t.prototype._getUserSettingsLabelForKeybinding=function(e){return e?e.isDuplicateModifierCase()?"":Ya.toUserSettingsUS(e.keyCode):null},t.prototype.getUserSettingsLabel=function(){var e=this._getUserSettingsLabelForKeybinding(this._firstPart),t=this._getUserSettingsLabelForKeybinding(this._chordPart),n=FF.toLabel(this._firstPart,e,this._chordPart,t,this._os);return n?n.toLowerCase():n},t.prototype.isWYSIWYG=function(){return!0},t.prototype.isChord=function(){return!!this._chordPart},t.prototype.getParts=function(){return[this._toResolvedKeybindingPart(this._firstPart),this._toResolvedKeybindingPart(this._chordPart)]},t.prototype._toResolvedKeybindingPart=function(e){return e?new ru(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getUILabelForKeybinding(e),this._getAriaLabelForKeybinding(e)):null},t.prototype.getDispatchParts=function(){return[this._firstPart?t.getDispatchStr(this._firstPart):null,this._chordPart?t.getDispatchStr(this._chordPart):null]},t.getDispatchStr=function(e){if(e.isModifierKey())return null;var t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Ya.toString(e.keyCode)},t}(iu),WF=function(){function e(t,n){this._defaultKeybindings=t,this._defaultBoundCommands=new Map;for(var r=0,i=t.length;r=0;c--)this._isTargetedForRemoval(e[c],a,u,s,l)&&e.splice(c,1);else n.push(o)}return e.concat(n)},e.prototype._addKeyPress=function(t,n){var r=this._map.get(t);if(void 0===r)return this._map.set(t,[n]),void this._addToLookupMap(n);for(var i=r.length-1;i>=0;i--){var o=r[i];if(o.command!==n.command){var s=null!==o.keypressChordPart,a=null!==n.keypressChordPart;s&&a&&o.keypressChordPart!==n.keypressChordPart||e.whenIsEntirelyIncluded(o.when,n.when)&&this._removeFromLookupMap(o)}}r.push(n),this._addToLookupMap(n)},e.prototype._addToLookupMap=function(e){if(e.command){var t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}},e.prototype._removeFromLookupMap=function(e){var t=this._lookupMap.get(e.command);if(void 0!==t)for(var n=0,r=t.length;n=0;i--)n[r++]=t[i];return n},e.prototype.lookupPrimaryKeybinding=function(e){var t=this._lookupMap.get(e);return void 0===t||0===t.length?null:t[t.length-1]},e.prototype.resolve=function(e,t,n){var r=null;if(null!==t){if(void 0===(a=this._map.get(t)))return null;r=[];for(var i=0,o=a.length;i=0;r--){var i=n[r];if(e.contextMatchesRules(t,i.when))return i}return null},e.contextMatchesRules=function(e,t){return!t||t.evaluate(e)},e.getAllUnboundCommands=function(e){var t=Ga.getCommands(),n=[];for(var r in t)"_"!==r[0]&&0!==r.indexOf("vscode.")&&("object"!=typeof t[r].description||Zn(t[r].description.args))&&!0!==e.get(r)&&n.push(r);return n},e}();function VF(e,t){void 0===t&&(t=!1);var n=0,r=e.length,i="",o=0,s=BF.Unknown,a=PF.None;function u(t,r){for(var i=0,o=0;i=48&&s<=57)o=16*o+s-48;else if(s>=65&&s<=70)o=16*o+s-65+10;else{if(!(s>=97&&s<=102))break;o=16*o+s-97+10}n++,i++}return i=r)return o=r,s=BF.EOF;var t=e.charCodeAt(n);if(HF(t)){do{n++,i+=String.fromCharCode(t),t=e.charCodeAt(n)}while(HF(t));return s=BF.Trivia}if(UF(t))return n++,i+=String.fromCharCode(t),13===t&&10===e.charCodeAt(n)&&(n++,i+="\n"),s=BF.LineBreakTrivia;switch(t){case 123:return n++,s=BF.OpenBraceToken;case 125:return n++,s=BF.CloseBraceToken;case 91:return n++,s=BF.OpenBracketToken;case 93:return n++,s=BF.CloseBracketToken;case 58:return n++,s=BF.ColonToken;case 44:return n++,s=BF.CommaToken;case 34:return n++,i=function(){for(var t="",i=n;;){if(n>=r){t+=e.substring(i,n),a=PF.UnexpectedEndOfString;break}var o=e.charCodeAt(n);if(34===o){t+=e.substring(i,n),n++;break}if(92!==o){if(o>=0&&o<=31){if(UF(o)){t+=e.substring(i,n),a=PF.UnexpectedEndOfString;break}a=PF.InvalidCharacter}n++}else{if(t+=e.substring(i,n),++n>=r){a=PF.UnexpectedEndOfString;break}switch(o=e.charCodeAt(n++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:var s=u(4,!0);s>=0?t+=String.fromCharCode(s):a=PF.InvalidUnicode;break;default:a=PF.InvalidEscapeCharacter}i=n}}return t}(),s=BF.StringLiteral;case 47:var l=n-1;if(47===e.charCodeAt(n+1)){for(n+=2;n=BF.LineCommentTrivia&&e<=BF.Trivia);return e}:l,getToken:function(){return s},getTokenValue:function(){return i},getTokenOffset:function(){return o},getTokenLength:function(){return n-o},getTokenError:function(){return a}}}function HF(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function UF(e){return 10===e||13===e||8232===e||8233===e}function YF(e){return e>=48&&e<=57}function ZF(e,t,n){var r=VF(e,!1);function i(e){return e?function(){return e(r.getTokenOffset(),r.getTokenLength())}:function(){return!0}}function o(e){return e?function(t){return e(t,r.getTokenOffset(),r.getTokenLength())}:function(){return!0}}var s=i(t.onObjectBegin),a=o(t.onObjectProperty),u=i(t.onObjectEnd),l=i(t.onArrayBegin),c=i(t.onArrayEnd),h=o(t.onLiteralValue),d=o(t.onSeparator),p=o(t.onError),f=n&&n.disallowComments,g=n&&n.allowTrailingComma;function m(){for(;;){var e=r.scan();switch(e){case BF.LineCommentTrivia:case BF.BlockCommentTrivia:f&&v(RF.InvalidSymbol);break;case BF.Unknown:v(RF.InvalidSymbol);break;case BF.Trivia:case BF.LineBreakTrivia:break;default:return e}}}function v(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),p(e),t.length+n.length>0)for(var i=r.getToken();i!==BF.EOF;){if(-1!==t.indexOf(i)){m();break}if(-1!==n.indexOf(i))break;i=m()}}function y(e){var t=r.getTokenValue();return e?h(t):a(t),m(),!0}function b(){switch(r.getToken()){case BF.OpenBracketToken:return function(){l(),m();for(var e=!1;r.getToken()!==BF.CloseBracketToken&&r.getToken()!==BF.EOF;){if(r.getToken()===BF.CommaToken){if(e||v(RF.ValueExpected,[],[]),d(","),m(),r.getToken()===BF.CloseBracketToken&&g)break}else e&&v(RF.CommaExpected,[],[]);b()||v(RF.ValueExpected,[],[BF.CloseBracketToken,BF.CommaToken]),e=!0}return c(),r.getToken()!==BF.CloseBracketToken?v(RF.CloseBracketExpected,[BF.CloseBracketToken],[]):m(),!0}();case BF.OpenBraceToken:return function(){s(),m();for(var e=!1;r.getToken()!==BF.CloseBraceToken&&r.getToken()!==BF.EOF;){if(r.getToken()===BF.CommaToken){if(e||v(RF.ValueExpected,[],[]),d(","),m(),r.getToken()===BF.CloseBraceToken&&g)break}else e&&v(RF.CommaExpected,[],[]);(r.getToken()!==BF.StringLiteral?(v(RF.PropertyNameExpected,[],[BF.CloseBraceToken,BF.CommaToken]),0):(y(!1),r.getToken()===BF.ColonToken?(d(":"),m(),b()||v(RF.ValueExpected,[],[BF.CloseBraceToken,BF.CommaToken])):v(RF.ColonExpected,[],[BF.CloseBraceToken,BF.CommaToken]),1))||v(RF.ValueExpected,[],[BF.CloseBraceToken,BF.CommaToken]),e=!0}return u(),r.getToken()!==BF.CloseBraceToken?v(RF.CloseBraceExpected,[BF.CloseBraceToken],[]):m(),!0}();case BF.StringLiteral:return y(!0);default:return function(){switch(r.getToken()){case BF.NumericLiteral:var e=0;try{"number"!=typeof(e=JSON.parse(r.getTokenValue()))&&(v(RF.InvalidNumberFormat),e=0)}catch(e){v(RF.InvalidNumberFormat)}h(e);break;case BF.NullKeyword:h(null);break;case BF.TrueKeyword:h(!0);break;case BF.FalseKeyword:h(!1);break;default:return!1}return m(),!0}()}}return m(),r.getToken()===BF.EOF||(b()?(r.getToken()!==BF.EOF&&v(RF.EndOfFileExpected,[],[]),!0):(v(RF.ValueExpected,[],[]),!1))}!function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"}(PF||(PF={})),function(e){e[e.Unknown=0]="Unknown",e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.EOF=16]="EOF"}(BF||(BF={})),function(e){e[e.InvalidSymbol=0]="InvalidSymbol",e[e.InvalidNumberFormat=1]="InvalidNumberFormat",e[e.PropertyNameExpected=2]="PropertyNameExpected",e[e.ValueExpected=3]="ValueExpected",e[e.ColonExpected=4]="ColonExpected",e[e.CommaExpected=5]="CommaExpected",e[e.CloseBraceExpected=6]="CloseBraceExpected",e[e.CloseBracketExpected=7]="CloseBracketExpected",e[e.EndOfFileExpected=8]="EndOfFileExpected"}(RF||(RF={}));var GF=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),KF=function(){function e(e,t,n){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===n&&(n=[]),this._contents=e,this._keys=t,this._overrides=n,this.isFrozen=!1}return Object.defineProperty(e.prototype,"contents",{get:function(){return this.checkAndFreeze(this._contents)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overrides",{get:function(){return this.checkAndFreeze(this._overrides)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keys",{get:function(){return this.checkAndFreeze(this._keys)},enumerable:!0,configurable:!0}),e.prototype.getValue=function(e){return e?SA(this.contents,e):this.contents},e.prototype.override=function(t){var n=this.getContentsForOverrideIdentifer(t);if(!n||"object"!=typeof n||!Object.keys(n).length)return this;for(var r={},i=0,o=Gn(Object.keys(this.contents).concat(Object.keys(n)));i0;){var n=t.shift();for(var r in Object.freeze(n),n)if(hs.call(n,r)){var i=n[r];"object"!=typeof i||Object.isFrozen(i)||t.push(i)}}return e}(e):e},e.prototype.getContentsForOverrideIdentifer=function(e){for(var t=0,n=this.overrides;t=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}),JF=function(e,t){return function(n,r){t(n,r,e)}},$F=function(){function e(t,n,r,i){var o=this;this._commandService=r,this._contextKeyService=i,this._menuGroups=[],this._disposables=[],this._onDidChange=new wn,n.then(function(n){var r,i=ku.getMenuItems(t),s=new Set;i.sort(e._compareMenuItems);for(var a=0,u=i;a0&&t.push([o,s])}return t},e._fillInKbExprKeys=function(e,t){if(e)for(var n=0,r=e.keys();ns)return 1;var a="string"==typeof e.command.title?e.command.title:e.command.title.value,u="string"==typeof t.command.title?t.command.title:t.command.title.value;return a.localeCompare(u)},e=XF([JF(2,Za),JF(3,Su)],e)}(),eO=function(){return function(e,t,n,r,i){if(this.resolvedKeybinding=e,e){var o=e.getDispatchParts(),s=o[0],a=o[1];this.keypressFirstPart=s,this.keypressChordPart=a}else this.keypressFirstPart=null,this.keypressChordPart=null;this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=r,this.isDefault=i}}(),tO=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nO=function(){function e(e){this._widget=e}return e.prototype.getId=function(){return"editor"},e.prototype.getControl=function(){return this._widget},e.prototype.focus=function(){this._widget.focus()},e.prototype.isVisible=function(){return!0},e.prototype.withTypedEditor=function(e,t){return zu(this._widget)?e(this._widget):t(this._widget)},e}(),rO=function(){function e(e){this.model=e,this._onDispose=new wn}return Object.defineProperty(e.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!0,configurable:!0}),e.prototype.load=function(){return cn.b.as(this)},Object.defineProperty(e.prototype,"textEditorModel",{get:function(){return this.model},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._onDispose.fire()},e}(),iO=function(){function e(){this.openEditorDelegate=null}return e.prototype.setEditor=function(e){this.editor=new nO(e)},e.prototype.setOpenEditorDelegate=function(e){this.openEditorDelegate=e},e.prototype.openEditor=function(e,t){var n=this;return cn.b.as(this.editor.withTypedEditor(function(t){return n.doOpenEditor(t,e)},function(t){return n.doOpenEditor(t.getOriginalEditor(),e)||n.doOpenEditor(t.getModifiedEditor(),e)}))},e.prototype.doOpenEditor=function(e,t){if(!this.findModel(e,t)){if(t.resource){if(this.openEditorDelegate)return this.openEditorDelegate(t.resource.toString()),null;var n=t.resource.scheme;if(n===Md.http||n===Md.https)return Ah(t.resource.toString()),this.editor}return null}var r=t.options.selection;if(r)if("number"==typeof r.endLineNumber&&"number"==typeof r.endColumn)e.setSelection(r),e.revealRangeInCenter(r,1);else{var i={lineNumber:r.startLineNumber,column:r.startColumn};e.setPosition(i),e.revealPositionInCenter(i,1)}return this.editor},e.prototype.findModel=function(e,t){var n=e.getModel();return n.uri.toString()!==t.resource.toString()?null:n},e}(),oO=function(){function e(){}return e.prototype.setEditor=function(e){this.editor=new nO(e)},e.prototype.createModelReference=function(e){var t,n=this;return(t=this.editor.withTypedEditor(function(t){return n.findModel(t,e)},function(t){return n.findModel(t.getOriginalEditor(),e)||n.findModel(t.getModifiedEditor(),e)}))?cn.b.as(new ln(new rO(t))):cn.b.as(new ln(null))},e.prototype.registerTextModelContentProvider=function(e,t){return{dispose:function(){}}},e.prototype.findModel=function(e,t){var n=e.getModel();return n.uri.toString()!==t.toString()?null:n},e}(),sO=function(){function e(){}return e.prototype.show=function(){return e.NULL_PROGRESS_RUNNER},e.prototype.showWhile=function(e,t){return null},e.NULL_PROGRESS_RUNNER={done:function(){},total:function(){},worked:function(){}},e}(),aO=function(){function e(){}return e.prototype.confirm=function(e){return this.doConfirm(e).then(function(e){return{confirmed:e,checkboxChecked:!1}})},e.prototype.doConfirm=function(e){var t=e.message;return e.detail&&(t=t+"\n\n"+e.detail),cn.b.wrap(window.confirm(t))},e.prototype.show=function(e,t,n,r){return cn.b.as(0)},e}(),uO=function(){function e(){}return e.prototype.info=function(e){return this.notify({severity:Ub.Info,message:e})},e.prototype.warn=function(e){return this.notify({severity:Ub.Warning,message:e})},e.prototype.error=function(e){return this.notify({severity:Ub.Error,message:e})},e.prototype.notify=function(t){switch(t.severity){case Ub.Error:console.error(t.message);break;case Ub.Warning:console.warn(t.message);break;default:console.log(t.message)}return e.NO_OP},e.prototype.prompt=function(t,n,r,i){return e.NO_OP},e.NO_OP=new Zb,e}(),lO=function(){function e(e){this._onWillExecuteCommand=new wn,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._instantiationService=e,this._dynamicCommands=Object.create(null)}return e.prototype.addCommand=function(e){var t=this,n=e.id;return this._dynamicCommands[n]=e,{dispose:function(){delete t._dynamicCommands[n]}}},e.prototype.executeCommand=function(e){for(var t=[],n=1;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},_O=function(e,t){return function(n,r){t(n,r,e)}},CO=0,wO=!1;function DO(){var e;wO||(wO=!0,e=document.body,(jw=document.createElement("div")).className="monaco-aria-container",(zw=document.createElement("div")).className="monaco-alert",zw.setAttribute("role","alert"),zw.setAttribute("aria-atomic","true"),jw.appendChild(zw),(Ww=document.createElement("div")).className="monaco-status",Ww.setAttribute("role","status"),Ww.setAttribute("aria-atomic","true"),jw.appendChild(Ww),e.appendChild(jw))}var EO=function(e){function t(t,n,r,i,o,s,a,u,l){var c=this;return(n=n||{}).ariaLabel=n.ariaLabel||ns("editorViewAccessibleLabel","Editor content"),n.ariaLabel=n.ariaLabel+";"+(Xl?ns("accessibilityHelpMessageIE","Press Ctrl+F1 for Accessibility Options."):ns("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")),c=e.call(this,t,n,r,i,o,s,u,l)||this,a instanceof cO&&(c._standaloneKeybindingService=a),DO(),c}return yO(t,e),t.prototype.addCommand=function(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;var r="DYNAMIC_"+ ++CO,i=mu.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(r,e,t,i),r},t.prototype.createContextKey=function(e,t){return this._contextKeyService.createKey(e,t)},t.prototype.addAction=function(e){var t=this;if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),rn;var n=e.id,r=e.label,i=mu.and(mu.equals("editorId",this.getId()),mu.deserialize(e.precondition)),o=e.keybindings,s=mu.and(i,mu.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,u=e.contextMenuOrder||0,l=function(){var n=e.run(t);return n||cn.b.as(void 0)},c=[],h=this.getId()+":"+n;if(c.push(Ga.registerCommand(h,l)),a){var d={command:{id:h,title:r},when:i,group:a,order:u};c.push(ku.appendMenuItem(Iu.EditorContext,d))}Array.isArray(o)&&(c=c.concat(o.map(function(e){return t._standaloneKeybindingService.addDynamicKeybinding(h,e,l,s)})));var p=new Hb(h,r,r,i,l,this._contextKeyService);return this._actions[n]=p,c.push({dispose:function(){delete t._actions[n]}}),sn(c)},t=bO([_O(2,Tr),_O(3,Wu),_O(4,Za),_O(5,Su),_O(6,HC),_O(7,Og),_O(8,Yb)],t)}(bx),AO=function(e){function t(t,n,r,i,o,s,a,u,l,c,h){var d=this;"string"==typeof(n=n||{}).theme&&c.setTheme(n.theme);var p=n.model;if(delete n.model,(d=e.call(this,t,n,i,o,s,a,u,c,h)||this)._contextViewService=l,d._register(r),void 0===p?(p=self.monaco.editor.createModel(n.value||"",n.language||"text/plain"),d._ownsModel=!0):d._ownsModel=!1,d._attachModel(p),p){var f={oldModelUrl:null,newModelUrl:p.uri};d._onDidChangeModel.fire(f)}return d}return yO(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._attachModel=function(t){e.prototype._attachModel.call(this,t),this._view&&this._contextViewService.setContainer(this._view.domNode.domNode)},t.prototype._postDetachModelCleanup=function(t){e.prototype._postDetachModelCleanup.call(this,t),t&&this._ownsModel&&(t.dispose(),this._ownsModel=!1)},t=bO([_O(3,Tr),_O(4,Wu),_O(5,Za),_O(6,Su),_O(7,HC),_O(8,WC),_O(9,vO),_O(10,Yb)],t)}(EO),SO=function(e){function t(t,n,r,i,o,s,a,u,l,c,h){var d=this;return"string"==typeof(n=n||{}).theme&&(n.theme=c.setTheme(n.theme)),(d=e.call(this,t,n,u,o,i,l,c,h)||this)._contextViewService=a,d._register(r),d._contextViewService.setContainer(d._containerDomElement),d}return yO(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._createInnerEditor=function(e,t,n){return e.createInstance(EO,t,n)},t.prototype.getOriginalEditor=function(){return e.prototype.getOriginalEditor.call(this)},t.prototype.getModifiedEditor=function(){return e.prototype.getModifiedEditor.call(this)},t.prototype.addCommand=function(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)},t.prototype.createContextKey=function(e,t){return this.getModifiedEditor().createContextKey(e,t)},t.prototype.addAction=function(e){return this.getModifiedEditor().addAction(e)},t=bO([_O(3,Tr),_O(4,Su),_O(5,HC),_O(6,WC),_O(7,uE),_O(8,Wu),_O(9,vO),_O(10,Yb)],t)}(kx),xO=(n(364),n(365),function(){function e(e,t,n){void 0===n&&(n={}),Mc(e,"monaco-menu-container");var r=document.createElement("div");Mc(r,"monaco-menu"),e.appendChild(r),this.actionBar=new zC(r,{orientation:EC.VERTICAL,actionItemProvider:n.actionItemProvider,context:n.context,actionRunner:n.actionRunner,isMenu:!0}),this.actionBar.push(t,{icon:!0,label:!0})}return Object.defineProperty(e.prototype,"onDidCancel",{get:function(){return this.actionBar.onDidCancel},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onDidBlur",{get:function(){return this.actionBar.onDidBlur},enumerable:!0,configurable:!0}),e.prototype.focus=function(){this.actionBar.focus(!0)},e.prototype.dispose=function(){this.actionBar&&(this.actionBar.dispose(),this.actionBar=null),this.listener&&(this.listener.dispose(),this.listener=null)},e}()),MO=function(){function e(e,t,n,r){var i=this;this.setContainer(e),this.contextViewService=t,this.telemetryService=n,this.notificationService=r,this.actionRunner=new du,this.menuContainerElement=null,this.toDispose=[];var o=!1;this.toDispose.push(this.actionRunner.onDidBeforeRun(function(e){i.telemetryService&&i.telemetryService.publicLog("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),(o=!!e.retainActionItem)||i.contextViewService.hideContextView(!1)})),this.toDispose.push(this.actionRunner.onDidRun(function(e){o&&i.contextViewService.hideContextView(!1),o=!1,e.error&&i.notificationService&&i.notificationService.error(e.error)}))}return e.prototype.setContainer=function(e){var t=this;this.$el&&(this.$el.off(["click","mousedown"]),this.$el=null),e&&(this.$el=Z_(e),this.$el.on("mousedown",function(e){return t.onMouseDown(e)}))},e.prototype.showContextMenu=function(e){var t=this;e.getActions().done(function(n){t.contextViewService.showContextView({getAnchor:function(){return e.getAnchor()},canRelayout:!1,render:function(r){t.menuContainerElement=r;var i=e.getMenuClassName?e.getMenuClassName():"";i&&(r.className+=" "+i);var o=new xO(r,n,{actionItemProvider:e.getActionItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:t.actionRunner}),s=o.onDidCancel(function(){t.contextViewService.hideContextView(!0)}),a=o.onDidBlur(function(){t.contextViewService.hideContextView(!0)});return o.focus(),sn([s,a,o])},onHide:function(n){e.onHide&&e.onHide(n),t.menuContainerElement=null}})})},e.prototype.onMouseDown=function(e){if(this.menuContainerElement){for(var t=new yc(e).target;t;){if(t===this.menuContainerElement)return;t=t.parentElement}this.contextViewService.hideContextView()}},e.prototype.dispose=function(){this.setContainer(null)},e}(),NO=function(){function e(e,t,n,r){this._onDidContextMenu=new wn,this.contextMenuHandler=new MO(e,r,t,n)}return e.prototype.dispose=function(){this.contextMenuHandler.dispose()},e.prototype.setContainer=function(e){this.contextMenuHandler.setContainer(e)},e.prototype.showContextMenu=function(e){this.contextMenuHandler.showContextMenu(e),this._onDidContextMenu.fire()},Object.defineProperty(e.prototype,"onDidContextMenu",{get:function(){return this._onDidContextMenu.event},enumerable:!0,configurable:!0}),e}(),IO=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},LO=function(e,t){return function(n,r){t(n,r,e)}},kO=function(){function e(e,t,n){this.logService=n,this.contextView=new Gw(e)}return e.prototype.dispose=function(){this.contextView.dispose()},e.prototype.setContainer=function(e){this.logService.trace("ContextViewService#setContainer"),this.contextView.setContainer(e)},e.prototype.showContextView=function(e){this.logService.trace("ContextViewService#showContextView"),this.contextView.show(e)},e.prototype.layout=function(){this.contextView.layout()},e.prototype.hideContextView=function(e){this.logService.trace("ContextViewService#hideContextView"),this.contextView.hide(e)},e=IO([LO(1,cu),LO(2,yk)],e)}(),TO=Object.prototype.hasOwnProperty;function FO(e,t){var n=function(n){if(TO.call(e,n)&&!1===t({key:n,value:e[n]},function(){delete e[n]}))return{value:void 0}};for(var r in e){var i=n(r);if("object"==typeof i)return i.value}}var OO,PO=function(){function e(e){this._hashFn=e,this._nodes=Object.create(null)}return e.prototype.roots=function(){var e=[];return FO(this._nodes,function(t){Qr(t.value.outgoing)&&e.push(t.value)}),e},e.prototype.traverse=function(e,t,n){var r=this.lookup(e);r&&this._traverse(r,t,Object.create(null),n)},e.prototype._traverse=function(e,t,n,r){var i=this,o=this._hashFn(e.data);n[o]||(n[o]=!0,r(e.data),FO(t?e.outgoing:e.incoming,function(e){return i._traverse(e.value,t,n,r)}))},e.prototype.insertEdge=function(e,t){var n=this.lookupOrInsertNode(e),r=this.lookupOrInsertNode(t);n.outgoing[this._hashFn(t)]=r,r.incoming[this._hashFn(e)]=n},e.prototype.removeNode=function(e){var t=this._hashFn(e);delete this._nodes[t],FO(this._nodes,function(e){delete e.value.outgoing[t],delete e.value.incoming[t]})},e.prototype.lookupOrInsertNode=function(e){var t=this._hashFn(e),n=this._nodes[t];return n||(n=function(e){return{data:e,incoming:Object.create(null),outgoing:Object.create(null)}}(e),this._nodes[t]=n),n},e.prototype.lookup=function(e){return this._nodes[this._hashFn(e)]},Object.defineProperty(e.prototype,"length",{get:function(){return Object.keys(this._nodes).length},enumerable:!0,configurable:!0}),e.prototype.toString=function(){var e=[];return FO(this._nodes,function(t){e.push(t.key+", (incoming)["+Object.keys(t.value.incoming).join(", ")+"], (outgoing)["+Object.keys(t.value.outgoing).join(",")+"]")}),e.join("\n")},e}(),BO=function(){function e(e,t){void 0===e&&(e=new Sh),void 0===t&&(t=!1),this._services=e,this._strict=t,this._services.set(Tr,this)}return e.prototype.createChild=function(t){var n=this;return this._services.forEach(function(e,r){t.has(e)||(r instanceof pu&&(r=n._createAndCacheServiceInstance(e,r)),t.set(e,r))}),new e(t,this._strict)},e.prototype.invokeFunction=function(e){for(var t,n=this,r=[],i=1;i0?r[0].index:n.length;if(n.length!==l){console.warn("[createInstance] First service dependency of "+e.ctor.name+" at position "+(l+1)+" conflicts with "+n.length+" static arguments");var c=l-n.length;n=c>0?n.concat(new Array(c)):n.slice(0,l)}var h=[e.ctor];return h.push.apply(h,n),h.push.apply(h,i),function(e){for(var t=[],n=1;n100&&r();for(var a=0,u=gr.getServiceDependencies(s.desc.ctor);a0?a:1,startColumn:u=u>0?u:1,endLineNumber:l=l>=a?l:a,endColumn:c=c>0?c:u,relatedInformation:h}},e.prototype.changeAll=function(t,n){var r=[],i=this._byOwner[t];if(i)for(var o in delete this._byOwner[t],i){var s=OO.get(this._byResource,o,t)[0];s&&r.push(s.resource),OO.remove(this._byResource,o,t)}if(!Zn(n)){for(var a=Object.create(null),u=0,l=n;u0&&this._onMarkerChanged.fire(r)},e.prototype.read=function(t){void 0===t&&(t=Object.create(null));var n=t.owner,r=t.resource,i=t.severities,o=t.take;if((!o||o<0)&&(o=-1),n&&r){if(b=OO.get(this._byResource,r.toString(),n)){for(var s=[],a=0,u=b;a0&&c===o)break}}return s}return[]}if(n||r){var h=n?this._byOwner[n]:this._byResource[r.toString()];if(!h)return[];s=[];for(var d in h)for(var p=0,f=h[d];p0&&c===o)return s}}return s}var s=[];for(var g in this._byResource)for(var m in this._byResource[g])for(var v=0,y=this._byResource[g][m];v0&&c===o)return s}}return s},e._accept=function(e,t){return void 0===t||(t&e.severity)===e.severity},e._debouncer=function(t,n){t||(e._dedupeMap=Object.create(null),t=[]);for(var r=0,i=n;r1&&f>1;){if(h.charCodeAt(p-2)!==d.charCodeAt(f-2))break;p--,f--}(p>1||f>1)&&this._pushTrimWhitespaceCharChange(i,o+1,1,p,s+1,1,f);for(var g=$O._getLastNonBlankColumn(h,1),m=$O._getLastNonBlankColumn(d,1),v=h.length+1,y=d.length+1;gt&&(t=a),s>n&&(n=s),u>n&&(n=u)}var l=new Ts(++n,++t,0);for(r=0,i=e.length;r=this._maxCharCode?0:this._states.get(e,t)},e}(),oP=null;var sP=null;var aP=function(){function e(){}return e._createLink=function(e,t,n,r,i){var o=i-1;do{var s=t.charCodeAt(o);if(2!==e.get(s))break;o--}while(o>r);if(r>0){var a=t.charCodeAt(r-1),u=t.charCodeAt(o);(40===a&&41===u||91===a&&93===u||123===a&&125===u)&&o--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:o+2},url:t.substring(r,o+1)}},e.computeLinks=function(t){for(var n=(null===oP&&(oP=new iP([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),oP),r=function(){if(null===sP){sP=new Ps(0);for(var e=0;e<" \t<>'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…".length;e++)sP.set(" \t<>'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…".charCodeAt(e),1);for(e=0;e<".,;".length;e++)sP.set(".,;".charCodeAt(e),2)}return sP}(),i=[],o=1,s=t.getLineCount();o<=s;o++){for(var a=t.getLineContent(o),u=a.length,l=0,c=0,h=0,d=1,p=!1,f=!1,g=!1;l=0?((r+=n?1:-1)<0?r=e.length-1:r%=e.length,e[r]):null},e.INSTANCE=new e,e}(),lP=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cP=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return lP(t,e),Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._versionId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eol",{get:function(){return this._eol},enumerable:!0,configurable:!0}),t.prototype.getValue=function(){return this.getText()},t.prototype.getLinesContent=function(){return this._lines.slice(0)},t.prototype.getLineCount=function(){return this._lines.length},t.prototype.getLineContent=function(e){return this._lines[e-1]},t.prototype.getWordAtPosition=function(e,t){var n=Uo(e.column,Ho(t),this._lines[e.lineNumber-1],0);return n?new be(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn):null},t.prototype.getWordUntilPosition=function(e,t){var n=this.getWordAtPosition(e,t);return n?{word:this._lines[e.lineNumber-1].substring(n.startColumn-1,e.column-1),startColumn:n.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}},t.prototype.createWordIterator=function(e){var t,n=this,r={done:!1,value:""},i=0,o=0,s=[],a=function(){if(o=n._lines.length))return t=n._lines[i],s=n._wordenize(t,e),o=0,i+=1,a();r.done=!0,r.value=void 0}return r};return{next:a}},t.prototype._wordenize=function(e,t){var n,r=[];for(t.lastIndex=0;(n=t.exec(e))&&0!==n[0].length;)r.push({start:n.index,end:n.index+n[0].length});return r},t.prototype.getValueInRange=function(e){if((e=this._validateRange(e)).startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);var t=this._eol,n=e.startLineNumber-1,r=e.endLineNumber-1,i=[];i.push(this._lines[n].substring(e.startColumn-1));for(var o=n+1;othis._lines.length)t=this._lines.length,n=this._lines[t-1].length+1,r=!0;else{var i=this._lines[t-1].length+1;n<1?(n=1,r=!0):n>i&&(n=i,r=!0)}return r?{lineNumber:t,column:n}:e},t}(rP),hP=function(e){function t(t){var n=e.call(this,t)||this;return n._models=Object.create(null),n}return lP(t,e),t.prototype.dispose=function(){this._models=Object.create(null)},t.prototype._getModel=function(e){return this._models[e]},t.prototype._getModels=function(){var e=this,t=[];return Object.keys(this._models).forEach(function(n){return t.push(e._models[n])}),t},t.prototype.acceptNewModel=function(e){this._models[e.url]=new cP(Be.parse(e.url),e.lines,e.EOL,e.versionId)},t.prototype.acceptModelChanged=function(e,t){this._models[e]&&this._models[e].onEvents(t)},t.prototype.acceptRemovedModel=function(e){this._models[e]&&delete this._models[e]},t}(function(){function e(e){this._foreignModuleFactory=e,this._foreignModule=null}return e.prototype.computeDiff=function(e,t,n){var r=this._getModel(e),i=this._getModel(t);if(!r||!i)return null;var o=r.getLinesContent(),s=i.getLinesContent(),a=new nP(o,s,{shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0});return cn.b.as(a.computeDiff())},e.prototype.computeDirtyDiff=function(e,t,n){var r=this._getModel(e),i=this._getModel(t);if(!r||!i)return null;var o=r.getLinesContent(),s=i.getLinesContent(),a=new nP(o,s,{shouldPostProcessCharChanges:!1,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0});return cn.b.as(a.computeDiff())},e.prototype.computeMoreMinimalEdits=function(t,n){var r=this._getModel(t);if(!r)return cn.b.as(n);for(var i,o=[],s=0,a=n;se._diffLimit)o.push({range:l,text:c});else for(var p=XM(d,c,!1),f=r.offsetAt(be.lift(l).getStartPosition()),g=0,m=p;g=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},gP=function(e,t){return function(n,r){t(n,r,e)}},mP=6e4,vP=3e5;function yP(e,t){var n=e.getModel(t);return!!n&&!n.isTooLargeForTokenization()}var bP=function(e){function t(t,n){var r=e.call(this)||this;return r._modelService=t,r._workerManager=r._register(new CP(r._modelService)),r._register(Ei.register("*",{provideLinks:function(e,t){return yP(r._modelService,e.uri)?function(e,t,n){var r=e.onCancellationRequested(function(){return t.cancel()});return n&&(t=t.then(void 0,function(e){if(!vn(e))return cn.b.wrapError(e)})),zl(t,function(){return r.dispose()})}(t,r._workerManager.withWorker().then(function(t){return t.computeLinks(e.uri)})):cn.b.as([])}})),r._register(hi.register("*",new _P(r._workerManager,n,r._modelService))),r}return pP(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.canComputeDiff=function(e,t){return yP(this._modelService,e)&&yP(this._modelService,t)},t.prototype.computeDiff=function(e,t,n){return this._workerManager.withWorker().then(function(r){return r.computeDiff(e,t,n)})},t.prototype.canComputeDirtyDiff=function(e,t){return yP(this._modelService,e)&&yP(this._modelService,t)},t.prototype.computeDirtyDiff=function(e,t,n){return this._workerManager.withWorker().then(function(r){return r.computeDirtyDiff(e,t,n)})},t.prototype.computeMoreMinimalEdits=function(e,t){return Array.isArray(t)&&0!==t.length&&yP(this._modelService,e)?this._workerManager.withWorker().then(function(n){return n.computeMoreMinimalEdits(e,t)}):cn.b.as(t)},t.prototype.canNavigateValueSet=function(e){return yP(this._modelService,e)},t.prototype.navigateValueSet=function(e,t,n){return this._workerManager.withWorker().then(function(r){return r.navigateValueSet(e,t,n)})},t=fP([gP(0,Br),gP(1,dP)],t)}(un),_P=function(){function e(e,t,n){this._workerManager=e,this._configurationService=t,this._modelService=n}return e.prototype.provideCompletionItems=function(e,t){if(this._configurationService.getValue(e.uri,t,"editor").wordBasedSuggestions&&yP(this._modelService,e.uri))return this._workerManager.withWorker().then(function(n){return n.textualSuggest(e.uri,t)})},e}(),CP=function(e){function t(t){var n=e.call(this)||this;return n._modelService=t,n._editorWorkerClient=null,n._register(new Ul).cancelAndSet(function(){return n._checkStopIdleWorker()},Math.round(vP/2)),n._register(n._modelService.onModelRemoved(function(e){return n._checkStopEmptyWorker()})),n}return pP(t,e),t.prototype.dispose=function(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),e.prototype.dispose.call(this)},t.prototype._checkStopEmptyWorker=function(){this._editorWorkerClient&&(0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null))},t.prototype._checkStopIdleWorker=function(){this._editorWorkerClient&&((new Date).getTime()-this._lastWorkerUsedTime>vP&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null))},t.prototype.withWorker=function(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new EP(this._modelService,"editorWorkerService")),cn.b.as(this._editorWorkerClient)},t}(un),wP=function(e){function t(t,n,r){var i=e.call(this)||this;if(i._syncedModels=Object.create(null),i._syncedModelsLastUsedTime=Object.create(null),i._proxy=t,i._modelService=n,!r){var o=new Ul;o.cancelAndSet(function(){return i._checkStopModelSync()},Math.round(mP/2)),i._register(o)}return i}return pP(t,e),t.prototype.dispose=function(){for(var t in this._syncedModels)on(this._syncedModels[t]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),e.prototype.dispose.call(this)},t.prototype.esureSyncedResources=function(e){for(var t=0;tmP&&t.push(n)}for(var r=0;r=0}}(e);MP.push(n),n.userConfigured?IP.push(n):NP.push(n),t&&!n.userConfigured&&MP.forEach(function(e){e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn("Overwriting extension <<"+n.extension+">> to now point to mime <<"+n.mime+">>"),n.filename&&e.filename===n.filename&&console.warn("Overwriting filename <<"+n.filename+">> to now point to mime <<"+n.mime+">>"),n.filepattern&&e.filepattern===n.filepattern&&console.warn("Overwriting filepattern <<"+n.filepattern+">> to now point to mime <<"+n.mime+">>"),n.firstline&&e.firstline===n.firstline&&console.warn("Overwriting firstline <<"+n.firstline+">> to now point to mime <<"+n.mime+">>"))})}function kP(e,t){if(!e)return[xP];var n=er(e=e.toLowerCase()),r=TP(e,n,IP);if(r)return[r,SP];var i=TP(e,n,NP);if(i)return[i,SP];if(t){var o=function(e){Qt(e)&&(e=e.substr(1));if(e.length>0)for(var t=0;t0)return n.mime}}return null}(t);if(o)return[o,SP]}return[xP]}function TP(e,t,n){for(var r,i,o,s=n.length-1;s>=0;s--){var a=n[s];if(t===a.filenameLowercase){r=a;break}if(a.filepattern&&(!i||a.filepattern.length>i.filepattern.length)){var u=a.filepatternOnPath?e:t;Nr(a.filepatternLowercase,u)&&(i=a)}a.extension&&(!o||a.extension.length>o.extension.length)&&ut(t,a.extensionLowercase)&&(o=a)}return r?r.mime:i?i.mime:o?o.mime:null}var FP=new(function(){function e(){this._onDidAddLanguages=new wn,this.onDidAddLanguages=this._onDidAddLanguages.event,this._languages=[]}return e.prototype.registerLanguage=function(e){this._languages.push(e),this._onDidAddLanguages.fire([e])},e.prototype.registerLanguages=function(e){this._languages=this._languages.concat(e),this._onDidAddLanguages.fire(e)},e.prototype.getLanguages=function(){return this._languages.slice(0)},e}());su.add("editor.modesRegistry",FP);var OP=new ni("plaintext",1);FP.registerLanguage({id:"plaintext",extensions:[".txt",".gitignore"],aliases:[ns("plainText.alias","Plain Text"),"text"],mimetypes:["text/plain"]}),Zo.register(OP,{brackets:[["(",")"],["[","]"],["{","}"]]});var PP=Object.prototype.hasOwnProperty,BP=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=!1);var n=this;this._nextLanguageId=1,this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},this._languageIds=[],this._warnOnOverwrite=t,e&&(this._registerLanguages(FP.getLanguages()),FP.onDidAddLanguages(function(e){return n._registerLanguages(e)}))}return e.prototype._registerLanguages=function(e){var t=this;if(0!==e.length){for(var n=0;n0&&((m=e.mimetypes).push.apply(m,t.mimetypes),r=t.mimetypes[0]),r||(r="text/x-"+n,e.mimetypes.push(r)),Array.isArray(t.extensions))for(var i=0,o=t.extensions;i0){var d=t.firstLine;"^"!==d.charAt(0)&&(d="^"+d);try{var p=new RegExp(d);ct(p)||LP({id:n,mime:r,firstline:p},this._warnOnOverwrite)}catch(e){pn(e)}}e.aliases.push(n);var f=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(f=0===t.aliases.length?[null]:t.aliases),null!==f)for(var g=0;g0;if(v&&null===f[0]);else{var y=(v?f[0]:null)||n;!v&&e.name||(e.name=y)}"string"==typeof t.configuration&&e.configurationFiles.push(t.configuration)},e.prototype.isRegisteredMode=function(e){return!!PP.call(this._mimeTypesMap,e)||PP.call(this._languages,e)},e.prototype.getRegisteredModes=function(){return Object.keys(this._languages)},e.prototype.getRegisteredLanguageNames=function(){return Object.keys(this._nameMap)},e.prototype.getLanguageName=function(e){return PP.call(this._languages,e)?this._languages[e].name:null},e.prototype.getModeIdForLanguageNameLowercase=function(e){return PP.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e].language:null},e.prototype.getConfigurationFiles=function(e){return PP.call(this._languages,e)&&this._languages[e].configurationFiles||[]},e.prototype.getMimeForMode=function(e){return PP.call(this._languages,e)&&this._languages[e].mimetypes[0]||null},e.prototype.extractModeIds=function(e){var t=this;return e?e.split(",").map(function(e){return e.trim()}).map(function(e){return PP.call(t._mimeTypesMap,e)?t._mimeTypesMap[e].language:e}).filter(function(e){return PP.call(t._languages,e)}):[]},e.prototype.getLanguageIdentifier=function(e){if("vs.editor.nullMode"===e||0===e)return bo;var t;if("string"==typeof e)t=e;else if(!(t=this._languageIds[e]))return null;return PP.call(this._languages,t)?this._languages[t].identifier:null},e.prototype.getModeIdsFromLanguageName=function(e){return e&&PP.call(this._nameMap,e)?[this._nameMap[e].language]:[]},e.prototype.getModeIdsFromFilenameOrFirstLine=function(e,t){if(!e&&!t)return[];var n=kP(e,t);return this.extractModeIds(n.join(","))},e.prototype.getExtensions=function(e){if(!PP.call(this._nameMap,e))return[];var t=this._nameMap[e];return this._languages[t.language].extensions},e.prototype.getFilenames=function(e){if(!PP.call(this._nameMap,e))return[];var t=this._nameMap[e];return this._languages[t.language].filenames},e}(),RP=function(){function e(e){void 0===e&&(e=!1),this._onDidCreateMode=new wn,this.onDidCreateMode=this._onDidCreateMode.event,this._instantiatedModes={},this._registry=new BP(!0,e)}return e.prototype._onReady=function(){return cn.b.as(!0)},e.prototype.isRegisteredMode=function(e){return this._registry.isRegisteredMode(e)},e.prototype.getRegisteredModes=function(){return this._registry.getRegisteredModes()},e.prototype.getRegisteredLanguageNames=function(){return this._registry.getRegisteredLanguageNames()},e.prototype.getExtensions=function(e){return this._registry.getExtensions(e)},e.prototype.getFilenames=function(e){return this._registry.getFilenames(e)},e.prototype.getMimeForMode=function(e){return this._registry.getMimeForMode(e)},e.prototype.getLanguageName=function(e){return this._registry.getLanguageName(e)},e.prototype.getModeIdForLanguageName=function(e){return this._registry.getModeIdForLanguageNameLowercase(e)},e.prototype.getModeIdByFilenameOrFirstLine=function(e,t){var n=this._registry.getModeIdsFromFilenameOrFirstLine(e,t);return n.length>0?n[0]:null},e.prototype.getModeId=function(e){var t=this._registry.extractModeIds(e);return t.length>0?t[0]:null},e.prototype.getLanguageIdentifier=function(e){return this._registry.getLanguageIdentifier(e)},e.prototype.getConfigurationFiles=function(e){return this._registry.getConfigurationFiles(e)},e.prototype.getMode=function(e){for(var t=this._registry.extractModeIds(e),n=!1,r=0;r0?t[0]:null},e.prototype.getOrCreateModeByFilenameOrFirstLine=function(e,t){var n=this;return this._onReady().then(function(){var r=n.getModeIdByFilenameOrFirstLine(e,t);return n._getOrCreateMode(r||"plaintext")})},e.prototype._getOrCreateMode=function(e){if(!this._instantiatedModes.hasOwnProperty(e)){var t=this.getLanguageIdentifier(e);this._instantiatedModes[e]=new AP(t),this._onDidCreateMode.fire(this._instantiatedModes[e])}return this._instantiatedModes[e]},e}(),jP=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},zP=function(e,t){return function(n,r){t(n,r,e)}};function WP(e){return e.toString()}var VP=function(){function e(e,t,n){this.model=e,this._markerDecorations=[],this._modelEventListeners=[],this._modelEventListeners.push(e.onWillDispose(function(){return t(e)})),this._modelEventListeners.push(e.onDidChangeLanguage(function(t){return n(e,t)}))}return e.prototype.dispose=function(){this._markerDecorations=this.model.deltaDecorations(this._markerDecorations,[]),this._modelEventListeners=on(this._modelEventListeners),this.model=null},e.prototype.acceptMarkerDecorations=function(e){this._markerDecorations=this.model.deltaDecorations(this._markerDecorations,e)},e}(),HP=function(){function e(){}return e.setMarkers=function(e,t){var n=this,r=t.read({resource:e.model.uri,take:500}).map(function(t){return{range:n._createDecorationRange(e.model,t),options:n._createDecorationOption(t)}});e.acceptMarkerDecorations(r)},e._createDecorationRange=function(e,t){var n=be.lift(t);if(t.severity===gE.Hint&&be.spansMultipleLines(n)&&(n=n.setEndPosition(n.startLineNumber,n.startColumn)),(n=e.validateRange(n)).isEmpty()){var r=e.getWordAtPosition(n.getStartPosition());if(r)n=new be(n.startLineNumber,r.startColumn,n.endLineNumber,r.endColumn);else{var i=e.getLineLastNonWhitespaceColumn(n.startLineNumber)||e.getLineMaxColumn(n.startLineNumber);1===i||(n=n.endColumn>=i?new be(n.startLineNumber,i-1,n.endLineNumber,i):new be(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn+1))}}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&n.startLineNumber===n.endLineNumber){var o=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);o0?(o=new be(i+1,1,n-a+1,1),s=new be(i+1,1,r-a+1,1)):i>0?(o=new be(i,e.getLineMaxColumn(i),n,e.getLineMaxColumn(n)),s=new be(i,1+t.getLineLength(i),r,1+t.getLineLength(r))):(o=new be(1,1,n,e.getLineMaxColumn(n)),s=new be(1,1,r,1+t.getLineLength(r))),[S_.replaceMove(o,t.getValueInRange(s,kn.TextDefined))]},e.prototype.createModel=function(e,t,n,r){var i;return void 0===r&&(r=!1),!t||cn.b.is(t)?(i=this._createModelData(e,OP,n,r),this.setMode(i.model,t)):i=this._createModelData(e,t.getLanguageIdentifier(),n,r),this._markerService&&HP.setMarkers(i,this._markerService),this._onModelAdded.fire(i.model),i.model},e.prototype.setMode=function(e,t){t&&(cn.b.is(t)?t.then(function(t){e.isDisposed()||e.setMode(t.getLanguageIdentifier())}):e.setMode(t.getLanguageIdentifier()))},e.prototype.destroyModel=function(e){var t=this._models[WP(e)];t&&t.model.dispose()},e.prototype.getModels=function(){for(var e=[],t=Object.keys(this._models),n=0,r=t.length;n=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},QP=function(e,t){return function(n,r){t(n,r,e)}},XP=function(e){function t(t,n){void 0===n&&(n=uh());var r=e.call(this)||this;return r._styleSheet=n,r._decorationOptionProviders=Object.create(null),r._themeService=t,r}return KP(t,e),t.prototype.registerDecorationType=function(e,t,n){var r=this._decorationOptionProviders[e];if(!r){var i={styleSheet:this._styleSheet,key:e,parentTypeKey:n,options:t||Object.create(null)};r=n?new JP(this._themeService,i):new $P(this._themeService,i),this._decorationOptionProviders[e]=r}r.refCount++},t.prototype.removeDecorationType=function(e){var t=this._decorationOptionProviders[e];t&&(t.refCount--,t.refCount<=0&&(delete this._decorationOptionProviders[e],t.dispose(),this.listCodeEditors().forEach(function(t){return t.removeDecorations(e)})))},t.prototype.resolveDecorationOptions=function(e,t){var n=this._decorationOptionProviders[e];if(!n)throw new Error("Unknown decoration type key: "+e);return n.getOptions(this,t)},t=qP([QP(0,Og)],t)}(ZP),JP=function(){function e(e,t){this._parentTypeKey=t.parentTypeKey,this.refCount=0,this._beforeContentRules=new tB(3,t,e),this._afterContentRules=new tB(4,t,e)}return e.prototype.getOptions=function(e,t){var n=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(n.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(n.afterContentClassName=this._afterContentRules.className),n},e.prototype.dispose=function(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null)},e}(),$P=function(){function e(e,t){var n=this;this.refCount=0,this._disposables=[];var r=function(r){var i=new tB(r,t,e);if(i.hasContent)return n._disposables.push(i),i.className};this.className=r(0);var i,o=(i=new tB(1,t,e)).hasContent?(n._disposables.push(i),{className:i.className,hasLetterSpacing:i.hasLetterSpacing}):null;o&&(this.inlineClassName=o.className,this.inlineClassNameAffectsLetterSpacing=o.hasLetterSpacing),this.beforeContentClassName=r(3),this.afterContentClassName=r(4),this.glyphMarginClassName=r(2);var s=t.options;this.isWholeLine=Boolean(s.isWholeLine),this.stickiness=s.rangeBehavior;var a=s.light&&s.light.overviewRulerColor||s.overviewRulerColor,u=s.dark&&s.dark.overviewRulerColor||s.overviewRulerColor;void 0===a&&void 0===u||(this.overviewRuler={color:a||u,darkColor:u||a,position:s.overviewRulerLane||Ln.Center})}return e.prototype.getOptions=function(e,t){return t?{inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness}:this},e.prototype.dispose=function(){this._disposables=on(this._disposables)},e}(),eB={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:url('{0}') center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:url('{0}');",margin:"margin:{0};",width:"width:{0};",height:"height:{0};"},tB=function(){function e(e,t,n){var r=this;this._theme=n.getTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;var i=nB.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(i=i+" "+nB.getClassName(this._providerArgs.parentTypeKey,e)),this._className=i,this._unThemedSelector=nB.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors&&(this._themeListener=n.onThemeChange(function(e){r._theme=n.getTheme(),r._removeCSS(),r._buildCSS()}))}return e.prototype.dispose=function(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)},Object.defineProperty(e.prototype,"hasContent",{get:function(){return this._hasContent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasLetterSpacing",{get:function(){return this._hasLetterSpacing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return this._className},enumerable:!0,configurable:!0}),e.prototype._buildCSS=function(){var e,t,n,r=this._providerArgs.options;switch(this._ruleType){case 0:e=this.getCSSTextForModelDecorationClassName(r),t=this.getCSSTextForModelDecorationClassName(r.light),n=this.getCSSTextForModelDecorationClassName(r.dark);break;case 1:e=this.getCSSTextForModelDecorationInlineClassName(r),t=this.getCSSTextForModelDecorationInlineClassName(r.light),n=this.getCSSTextForModelDecorationInlineClassName(r.dark);break;case 2:e=this.getCSSTextForModelDecorationGlyphMarginClassName(r),t=this.getCSSTextForModelDecorationGlyphMarginClassName(r.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(r.dark);break;case 3:e=this.getCSSTextForModelDecorationContentClassName(r.before),t=this.getCSSTextForModelDecorationContentClassName(r.light&&r.light.before),n=this.getCSSTextForModelDecorationContentClassName(r.dark&&r.dark.before);break;case 4:e=this.getCSSTextForModelDecorationContentClassName(r.after),t=this.getCSSTextForModelDecorationContentClassName(r.light&&r.light.after),n=this.getCSSTextForModelDecorationContentClassName(r.dark&&r.dark.after);break;default:throw new Error("Unknown rule type: "+this._ruleType)}var i=this._providerArgs.styleSheet.sheet,o=!1;e.length>0&&(i.insertRule(this._unThemedSelector+" {"+e+"}",0),o=!0),t.length>0&&(i.insertRule(".vs"+this._unThemedSelector+" {"+t+"}",0),o=!0),n.length>0&&(i.insertRule(".vs-dark"+this._unThemedSelector+", .hc-black"+this._unThemedSelector+" {"+n+"}",0),o=!0),this._hasContent=o},e.prototype._removeCSS=function(){hh(this._unThemedSelector,this._providerArgs.styleSheet)},e.prototype.getCSSTextForModelDecorationClassName=function(e){if(!e)return"";var t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")},e.prototype.getCSSTextForModelDecorationInlineClassName=function(e){if(!e)return"";var t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")},e.prototype.getCSSTextForModelDecorationContentClassName=function(e){if(!e)return"";var t=[];if(void 0!==e){if(this.collectBorderSettingsCSSText(e,t),void 0!==e.contentIconPath&&("string"==typeof e.contentIconPath?t.push($e(eB.contentIconPath,Be.file(e.contentIconPath).toString().replace(/'/g,"%27"))):t.push($e(eB.contentIconPath,Be.revive(e.contentIconPath).toString(!0).replace(/'/g,"%27")))),"string"==typeof e.contentText){var n=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push($e(eB.contentText,n))}this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","color","opacity","backgroundColor","margin"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")},e.prototype.getCSSTextForModelDecorationGlyphMarginClassName=function(e){if(!e)return"";var t=[];return void 0!==e.gutterIconPath&&("string"==typeof e.gutterIconPath?t.push($e(eB.gutterIconPath,Be.file(e.gutterIconPath).toString())):t.push($e(eB.gutterIconPath,Be.revive(e.gutterIconPath).toString(!0).replace(/'/g,"%27"))),void 0!==e.gutterIconSize&&t.push($e(eB.gutterIconSize,e.gutterIconSize))),t.join("")},e.prototype.collectBorderSettingsCSSText=function(e,t){return!!this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)&&(t.push($e("box-sizing: border-box;")),!0)},e.prototype.collectCSSText=function(e,t,n){for(var r=n.length,i=0,o=t;i=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},sB=function(e,t){return function(n,r){t(n,r,e)}},aB="data-keybinding-context",uB=function(){function e(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}return e.prototype.setValue=function(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)},e.prototype.removeValue=function(e){return e in this._value&&(delete this._value[e],!0)},e.prototype.getValue=function(e){var t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t},e.prototype.collectAllValues=function(){var e=this._parent?this._parent.collectAllValues():Object.create(null);return delete(e=iB({},e,this._value))._contextId,e},e}(),lB=function(e){function t(t,n,r){var i=e.call(this,t,null)||this;return i._emitter=r,i._configurationService=n,i._subscription=n.onDidChangeConfiguration(i._onConfigurationUpdated,i),i._initFromConfiguration(),i}return rB(t,e),t.prototype.dispose=function(){this._subscription.dispose()},t.prototype._onConfigurationUpdated=function(e){if(e.source===CA.DEFAULT)this._initFromConfiguration();else for(var t=0,n=e.affectedKeys;tt)return 1;return 0}(e.token,t.token);return 0!==n?n:e.index-t.index});for(var t=0,n="000000",r="ffffff";e.length>=1&&""===e[0].token;){var i=e.shift();-1!==i.fontStyle&&(t=i.fontStyle),null!==i.foreground&&(n=i.foreground),null!==i.background&&(r=i.background)}for(var o=new vB,s=new _B(t,o.getId(n),o.getId(r)),a=new wB(s),u=0,l=e.length;u>>0,this._cache.set(t,n)}return(n|e<<0)>>>0},e}(),bB=/\b(comment|string|regex)\b/;var _B=function(){function e(e,t,n){this._fontStyle=e,this._foreground=t,this._background=n,this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}return e.prototype.clone=function(){return new e(this._fontStyle,this._foreground,this._background)},e.prototype.acceptOverwrite=function(e,t,n){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==n&&(this._background=n),this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0},e}(),CB=function(){return function(e,t){this.mainRule=e,this.children=t||Object.create(null)}}(),wB=function(){function e(e){this._mainRule=e,this._children=new Map}return e.prototype.toExternalThemeTrieElement=function(){var e=Object.create(null);return this._children.forEach(function(t,n){e[n]=t.toExternalThemeTrieElement()}),new CB(this._mainRule,e)},e.prototype.match=function(e){if(""===e)return this._mainRule;var t,n,r=e.indexOf(".");-1===r?(t=e,n=""):(t=e.substring(0,r),n=e.substring(r+1));var i=this._children.get(t);return void 0!==i?i.match(n):this._mainRule},e.prototype.insert=function(t,n,r,i){if(""!==t){var o,s,a=t.indexOf(".");-1===a?(o=t,s=""):(o=t.substring(0,a),s=t.substring(a+1));var u=this._children.get(o);void 0===u&&(u=new e(this._mainRule.clone()),this._children.set(o,u)),u.insert(s,n,r,i)}else this._mainRule.acceptOverwrite(n,r,i)},e}();var DB,EB,AB,SB={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"09885A"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.jade",foreground:"4F76AC"},{token:"tag.class.jade",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"09885A"},{token:"attribute.value.unit",foreground:"09885A"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"FF00FF"}],colors:(DB={},DB[qf]="#FFFFFE",DB[Qf]="#000000",DB[tg]="#E5EBF1",DB[Qg]="#D3D3D3",DB[Xg]="#939393",DB[ng]="#ADD6FF4D",DB)},xB={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.jade",foreground:"4F76AC"},{token:"tag.class.jade",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:(EB={},EB[qf]="#1E1E1E",EB[Qf]="#D4D4D4",EB[tg]="#3A3D41",EB[Qg]="#404040",EB[Xg]="#707070",EB[ng]="#ADD6FF26",EB)},MB={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.jade",foreground:"4F76AC"},{token:"tag.class.jade",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:(AB={},AB[qf]="#000000",AB[Qf]="#FFFFFF",AB[Qg]="#FFFFFF",AB[Xg]="#FFFFFF",AB)},NB="vs",IB="vs-dark",LB="hc-black",kB=su.as(af),TB=su.as(zg),FB=function(){function e(e,t,n,r){for(var i in t.length>0?(this.id=e+" "+t,this.themeName=t):(this.id=e,this.themeName=e),this.base=e,this.rules=r,this.colors={},n)this.colors[i]=md.fromHex(n[i]);this.defaultColors={}}return e.prototype.getColor=function(e,t){return this.colors.hasOwnProperty(e)?this.colors[e]:!1!==t?this.getDefault(e):null},e.prototype.getDefault=function(e){if(this.defaultColors.hasOwnProperty(e))return this.defaultColors[e];var t=kB.resolveDefaultColor(e,this);return this.defaultColors[e]=t,t},e.prototype.defines=function(e){return this.colors.hasOwnProperty(e)},Object.defineProperty(e.prototype,"type",{get:function(){switch(this.base){case NB:return"light";case LB:return"hc";default:return"dark"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tokenTheme",{get:function(){return this._tokenTheme||(this._tokenTheme=yB.createFromRawTokenTheme(this.rules)),this._tokenTheme},enumerable:!0,configurable:!0}),e}();function OB(e){return e===NB||e===IB||e===LB}function PB(e){switch(e){case NB:return SB;case IB:return xB;case LB:return MB}}function BB(e){var t=PB(e);return new FB(e,"",t.colors,t.rules)}var RB=function(){function e(){this._onThemeChange=new wn,this._knownThemes=new Map,this._knownThemes.set(NB,BB(NB)),this._knownThemes.set(IB,BB(IB)),this._knownThemes.set(LB,BB(LB)),this._styleElement=uh(),this._styleElement.className="monaco-colors",this.setTheme(NB)}return Object.defineProperty(e.prototype,"onThemeChange",{get:function(){return this._onThemeChange.event},enumerable:!0,configurable:!0}),e.prototype.defineTheme=function(e,t){if(!/^[a-z0-9\-]+$/i.test(e)||OB(e))throw new Error("Illegal theme name!");if(!OB(t.base))throw new Error("Illegal theme base!");var n=[],r={};if(t.inherit){var i=PB(t.base);for(var o in n=n.concat(i.rules),i.colors)r[o]=i.colors[o]}for(var o in n=n.concat(t.rules),t.colors)r[o]=t.colors[o];this._knownThemes.set(e,new FB(t.base,e,r,n))},e.prototype.getTheme=function(){return this._theme},e.prototype.setTheme=function(e){var t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(NB),this._theme=t;var n=[],r={},i={addRule:function(e){r[e]||(n.push(e),r[e]=!0)}};TB.getThemingParticipants().forEach(function(e){return e(t,i)});var o=t.tokenTheme.getColorMap();return i.addRule(function(e){for(var t=[],n=1,r=e.length;n200)return t;if("object"==typeof t){switch(t.$mid){case 1:return Be.revive(t);case 2:return new RegExp(t.source,t.flags)}for(var r in t)Object.hasOwnProperty.call(t,r)&&(t[r]=e(t[r],n+1))}return t}(t,0)}var UB=new(function(){function e(){}return e.prototype.publicLog=function(e,t){return cn.b.wrap(null)},e.prototype.getTelemetryInfo=function(){return cn.b.wrap({instanceId:"someValue.instanceId",sessionId:"someValue.sessionId",machineId:"someValue.machineId"})},e}());var YB=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},ZB=function(e,t){return function(n,r){t(n,r,e)}},GB=function(){function e(e,t,n){void 0===n&&(n=UB),this._editorService=e,this._commandService=t,this._telemetryService=n}return e.prototype.open=function(e,t){this._telemetryService.publicLog("openerService",{scheme:e.scheme});var n,r=e.scheme,i=e.path,o=e.query,s=e.fragment,a=cn.b.wrap(void 0);if(r===Md.http||r===Md.https||r===Md.mailto)Ah(e.toString(!0));else if("command"===r&&Ga.getCommand(i)){var u=[];try{u=HB(o),Array.isArray(u)||(u=[u])}catch(e){}a=(n=this._commandService).executeCommand.apply(n,[i].concat(u))}else{var l=void 0,c=/^L?(\d+)(?:,(\d+))?/.exec(s);if(c&&(l={startLineNumber:parseInt(c[1]),startColumn:c[2]?parseInt(c[2]):1},e=e.with({fragment:""})),!e.scheme)return cn.b.as(void 0);e.scheme===Md.file&&(e=e.with({path:ir(e.path)})),a=this._editorService.openEditor({resource:e,options:{selection:l}},t&&t.openToSide)}return a},e=YB([ZB(0,Fu),ZB(1,Za),ZB(2,Pr(cu))],e)}(),KB=function(){function e(){}return e.colorizeElement=function(e,t,n,r){var i=(r=r||{}).theme||"vs",o=r.mimeType||n.getAttribute("lang")||n.getAttribute("data-lang");if(o){e.setTheme(i);var s=n.firstChild.nodeValue;n.className+=" "+i;var a=function(e){n.innerHTML=e};return this.colorize(t,s,o,r).then(a,function(e){return console.error(e)},a)}console.error("Mode not detected")},e._tokenizationSupportChangedPromise=function(e){var t=null,n=function(){t&&(t.dispose(),t=null)};return new cn.b(function(r,i,o){t=xi.onDidChange(function(t){t.changedLanguages.indexOf(e)>=0&&(n(),r(void 0))})},n)},e.colorize=function(e,t,n,r){Qt(t)&&(t=t.substr(1));var i=t.split(/\r\n|\r|\n/),o=e.getModeId(n);void 0===(r=r||{}).tabSize&&(r.tabSize=4),e.getOrCreateMode(o);var s=xi.get(o);return s?cn.b.as(qB(i,r.tabSize,s)):cn.b.any([this._tokenizationSupportChangedPromise(o),cn.b.timeout(500)]).then(function(e){var t=xi.get(o);return t?qB(i,r.tabSize,t):function(e,t){var n=[],r=new Uint32Array(2);r[0]=0,r[1]=16793600;for(var i=0,o=e.length;i")}return n.join("")}(i,r.tabSize)})},e.colorizeLine=function(e,t,n,r,i){void 0===i&&(i=4);var o=od.isBasicASCII(e,t),s=od.containsRTL(e,o,n);return tv(new Qm(!1,e,o,s,0,r,[],i,0,-1,"none",!1,!1)).html},e.colorizeModelLine=function(e,t,n){void 0===n&&(n=4);var r=e.getLineContent(t);e.forceTokenization(t);var i=e.getLineTokens(t).inflate();return this.colorizeLine(r,e.mightContainNonBasicASCII(),e.mightContainRTL(),i,n)},e}();function qB(e,t,n){return function(e,t,n){for(var r=[],i=n.getInitialState(),o=0,s=e.length;o"),i=u.endState}return r.join("")}(e,t,n)}var QB=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var XB,JB,$B=function(e){function t(t,n){var r=e.call(this,t,n.label)||this;return r._foreignModuleId=n.moduleId,r._foreignModuleCreateData=n.createData||null,r._foreignProxy=null,r}return QB(t,e),t.prototype._getForeignProxy=function(){var e=this;return this._foreignProxy||(this._foreignProxy=new jl(this._getProxy().then(function(t){return t.loadForeignModule(e._foreignModuleId,e._foreignModuleCreateData).then(function(n){e._foreignModuleId=null,e._foreignModuleCreateData=null;for(var r=function(e,n){return t.fmr(e,n)},i=function(e,t){return function(){var n=Array.prototype.slice.call(arguments,0);return t(e,n)}},o={},s=0;s=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));var t=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{var n=t.range.getStartPosition();this._editor.setPosition(n),this._editor.revealPositionInCenter(n,0)}finally{this.ignoreSelectionChange=!1}}},e.prototype.canNavigate=function(){return this.ranges&&this.ranges.length>0},e.prototype.next=function(){this._move(!0)},e.prototype.previous=function(){this._move(!1)},e.prototype.dispose=function(){on(this._disposables),this._disposables.length=0,this._onDidUpdate.dispose(),this.ranges=null,this.disposed=!0},e}();function nR(e,t,n){var r=new VB(e,t),i=null;r.has(Fu)||(i=new iO,r.set(Fu,i));var o=null;r.has(DM)||(o=new oO,r.set(DM,o)),r.has(nA)||r.set(nA,new GB(r.get(Fu),r.get(Za)));var s=n(r);return i&&i.setEditor(s),o&&o.setEditor(s),s}function rR(e,t,n){return nR(e,n,function(n){return new AO(e,t,n,n.get(Tr),n.get(Wu),n.get(Za),n.get(Su),n.get(HC),n.get(WC),n.get(vO),n.get(Yb))})}function iR(e){return zB.codeEditorService.get().onCodeEditorAdd(function(t){e(t)})}function oR(e,t,n){return nR(e,n,function(n){return new SO(e,t,n,n.get(Tr),n.get(Su),n.get(HC),n.get(WC),n.get(uE),n.get(Wu),n.get(vO),n.get(Yb))})}function sR(e,t){return new tR(e,t)}function aR(e,t,n){return zB.modelService.get().createModel(e,t,n)}function uR(e,t,n){if(e=e||"",!t){var r=n?n.path:null,i=e.indexOf("\n"),o=e;return-1!==i&&(o=e.substring(0,i)),aR(e,zB.modeService.get().getOrCreateModeByFilenameOrFirstLine(r,o),n)}return aR(e,zB.modeService.get().getOrCreateMode(t),n)}function lR(e,t){zB.modelService.get().setMode(e,zB.modeService.get().getOrCreateMode(t))}function cR(e,t,n){e&&zB.markerService.get().changeOne(t,e.uri,n)}function hR(e){return zB.markerService.get().read(e)}function dR(e){return zB.modelService.get().getModel(e)}function pR(){return zB.modelService.get().getModels()}function fR(e){return zB.modelService.get().onModelAdded(e)}function gR(e){return zB.modelService.get().onModelRemoved(e)}function mR(e){return zB.modelService.get().onModelModeChanged(function(t){e({model:t.model,oldLanguage:t.oldModeId})})}function vR(e){return function(e,t){return new $B(e,t)}(zB.modelService.get(),e)}function yR(e,t){return KB.colorizeElement(zB.standaloneThemeService.get(),zB.modeService.get(),e,t)}function bR(e,t,n){return KB.colorize(zB.modeService.get(),e,t,n)}function _R(e,t,n){return void 0===n&&(n=4),KB.colorizeModelLine(e,t,n)}function CR(e){var t=xi.get(e);return t||{getInitialState:function(){return yo},tokenize:function(t,n,r){return function(e,t,n,r){return new mo([new go(r,"",e)],n)}(e,0,n,r)},tokenize2:void 0}}function wR(e,t){zB.modeService.get().getOrCreateMode(t);for(var n=CR(t),r=e.split(/\r\n|\r|\n/),i=[],o=n.getInitialState(),s=0,a=r.length;s'"_]/g,"-")}function LR(e,t){throw new Error(e.languageId+": "+t)}function kR(e,t,n,r,i){var o=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,function(t,s,a,u,l,c,h,d,p){return MR(a)?MR(u)?!MR(l)&&l0;){var n=e.tokenizer[t];if(n)return n;var r=t.lastIndexOf(".");t=r<0?null:t.substr(0,r)}return null}function FR(e,t,n){return"boolean"==typeof e?e:(n&&(e||void 0===t)&&n(),void 0===t?null:t)}function OR(e,t,n){return"string"==typeof e?e:(n&&(e||void 0===t)&&n(),void 0===t?null:t)}function PR(e,t){if("string"!=typeof t)return null;for(var n=0;t.indexOf("@")>=0&&n<5;)n++,t=t.replace(/@(\w+)/g,function(n,r){var i="";return"string"==typeof e[r]?i=e[r]:e[r]&&e[r]instanceof RegExp?i=e[r].source:void 0===e[r]?LR(e,"language definition does not contain attribute '"+r+"', used at: "+t):LR(e,"attribute reference '"+r+"' must be a string, used at: "+t),MR(i)?"":"(?:"+i+")"});return new RegExp(t,e.ignoreCase?"i":"")}function BR(e,t,n,r){var i=-1,o=n,s=n.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);s&&(s[3]&&(i=parseInt(s[3]),s[2]&&(i+=100)),o=s[4]);var a,u="~",l=o;if(o&&0!==o.length?/^\w*$/.test(l)?u="==":(s=o.match(/^(@|!@|~|!~|==|!=)(.*)$/))&&(u=s[1],l=s[2]):(u="!=",l=""),"~"!==u&&"!~"!==u||!/^(\w|\|)*$/.test(l))if("@"===u||"!@"===u){var c=e[l];c||LR(e,"the @ match target '"+l+"' is not defined, in rule: "+t),function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;var n;for(n in t)if(t.hasOwnProperty(n)&&!e(t[n]))return!1;return!0}(function(e){return"string"==typeof e},c)||LR(e,"the @ match target '"+l+"' must be an array of strings, in rule: "+t);var h=fs(c,e.ignoreCase);a=function(e){return"@"===u?h(e):!h(e)}}else if("~"===u||"!~"===u)if(l.indexOf("$")<0){var d=PR(e,"^"+l+"$");a=function(e){return"~"===u?d.test(e):!d.test(e)}}else a=function(t,n,r,i){return PR(e,"^"+kR(e,l,n,r,i)+"$").test(t)};else if(l.indexOf("$")<0){var p=NR(e,l);a=function(e){return"=="===u?e===p:e!==p}}else{var f=NR(e,l);a=function(t,n,r,i,o){var s=kR(e,f,n,r,i);return"=="===u?t===s:t!==s}}else{var g=fs(l.split("|"),e.ignoreCase);a=function(e){return"~"===u?g(e):!g(e)}}return-1===i?{name:n,value:r,test:function(e,t,n,r){return a(e,e,t,n,r)}}:{name:n,value:r,test:function(e,t,n,r){var o=function(e,t,n,r){if(r<0)return e;if(r=100){r-=100;var i=n.split(".");if(i.unshift(n),r0&&"^"===n[0],this.name=this.name+": "+n,this.regex=PR(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")")},e.prototype.setAction=function(e,t){this.action=function e(t,n,r){if(r){if("string"==typeof r)return r;if(r.token||""===r.token){if("string"!=typeof r.token)return LR(t,"a 'token' attribute must be of type string, in rule: "+n),{token:""};var i={token:r.token};if(r.token.indexOf("$")>=0&&(i.tokenSubst=!0),"string"==typeof r.bracket&&("@open"===r.bracket?i.bracket=1:"@close"===r.bracket?i.bracket=-1:LR(t,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+n)),r.next)if("string"!=typeof r.next)LR(t,"the next state must be a string value in rule: "+n);else{var o=r.next;/^(@pop|@push|@popall)$/.test(o)||("@"===o[0]&&(o=o.substr(1)),o.indexOf("$")<0&&(function(e,t){for(;t&&t.length>0;){if(e.stateNames[t])return!0;var n=t.lastIndexOf(".");t=n<0?null:t.substr(0,n)}return!1}(t,kR(t,o,"",[],""))||LR(t,"the next state '"+r.next+"' is not defined in rule: "+n))),i.next=o}return"number"==typeof r.goBack&&(i.goBack=r.goBack),"string"==typeof r.switchTo&&(i.switchTo=r.switchTo),"string"==typeof r.log&&(i.log=r.log),"string"==typeof r.nextEmbedded&&(i.nextEmbedded=r.nextEmbedded,t.usesEmbedded=!0),i}if(Array.isArray(r)){var s,a=[];for(s in r)r.hasOwnProperty(s)&&(a[s]=e(t,n,r[s]));return{group:a}}if(r.cases){var u,l=[];for(u in r.cases)if(r.cases.hasOwnProperty(u)){var c=e(t,n,r.cases[u]);"@default"===u||"@"===u||""===u?l.push({test:null,value:c,name:u}):"@eos"===u?l.push({test:function(e,t,n,r){return r},value:c,name:u}):l.push(BR(t,n,u,c))}var h=t.defaultToken;return{test:function(e,t,n,r){var i;for(i in l)if(l.hasOwnProperty(i)&&(!l[i].test||l[i].test(e,t,n,r)))return l[i].value;return h}}}return LR(t,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+n),""}return{token:""}}(e,this.name,t)},e}();var jR=function(){function e(e){this._maxCacheDepth=e,this._entries=Object.create(null)}return e.create=function(e,t){return this._INSTANCE.create(e,t)},e.prototype.create=function(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new zR(e,t);var n=zR.getStackElementId(e);n.length>0&&(n+="|"),n+=t;var r=this._entries[n];return r||(r=new zR(e,t),this._entries[n]=r,r)},e._INSTANCE=new e(5),e}(),zR=function(){function e(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}return e.getStackElementId=function(e){for(var t="";null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t},e._equals=function(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t},e.prototype.equals=function(t){return e._equals(this,t)},e.prototype.push=function(e){return jR.create(this,e)},e.prototype.pop=function(){return this.parent},e.prototype.popall=function(){for(var e=this;e.parent;)e=e.parent;return e},e.prototype.switchTo=function(e){return jR.create(this.parent,e)},e}(),WR=function(){function e(e,t){this.modeId=e,this.state=t}return e.prototype.equals=function(e){return this.modeId===e.modeId&&this.state.equals(e.state)},e.prototype.clone=function(){return this.state.clone()===this.state?this:new e(this.modeId,this.state)},e}(),VR=function(){function e(e){this._maxCacheDepth=e,this._entries=Object.create(null)}return e.create=function(e,t){return this._INSTANCE.create(e,t)},e.prototype.create=function(e,t){if(null!==t)return new HR(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new HR(e,t);var n=zR.getStackElementId(e),r=this._entries[n];return r||(r=new HR(e,null),this._entries[n]=r,r)},e._INSTANCE=new e(5),e}(),HR=function(){function e(e,t){this.stack=e,this.embeddedModeData=t}return e.prototype.clone=function(){return(this.embeddedModeData?this.embeddedModeData.clone():null)===this.embeddedModeData?this:VR.create(this.stack,this.embeddedModeData)},e.prototype.equals=function(t){return t instanceof e&&(!!this.stack.equals(t.stack)&&(null===this.embeddedModeData&&null===t.embeddedModeData||null!==this.embeddedModeData&&null!==t.embeddedModeData&&this.embeddedModeData.equals(t.embeddedModeData)))},e}(),UR=Object.hasOwnProperty,YR=function(){function e(){this._tokens=[],this._language=null,this._lastTokenType=null,this._lastTokenLanguage=null}return e.prototype.enterMode=function(e,t){this._language=t},e.prototype.emit=function(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._language||(this._lastTokenType=t,this._lastTokenLanguage=this._language,this._tokens.push(new go(e,t,this._language)))},e.prototype.nestedModeTokenize=function(e,t,n){var r=t.modeId,i=t.state,o=xi.get(r);if(!o)return this.enterMode(n,r),this.emit(n,""),i;var s=o.tokenize(e,i,n);return this._tokens=this._tokens.concat(s.tokens),this._lastTokenType=null,this._lastTokenLanguage=null,this._language=null,s.endState},e.prototype.finalize=function(e){return new mo(this._tokens,e)},e}(),ZR=function(){function e(e,t){this._modeService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}return e.prototype.enterMode=function(e,t){this._currentLanguageId=this._modeService.getLanguageIdentifier(t).id},e.prototype.emit=function(e,t){var n=this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==n&&(this._lastTokenMetadata=n,this._tokens.push(e),this._tokens.push(n))},e._merge=function(e,t,n){var r=null!==e?e.length:0,i=t.length,o=null!==n?n.length:0;if(0===r&&0===i&&0===o)return new Uint32Array(0);if(0===r&&0===i)return n;if(0===i&&0===o)return e;var s=new Uint32Array(r+i+o);null!==e&&s.set(e);for(var a=0;a0&&r.nestedModeTokenize(s,t.embeddedModeData,n);var a=e.substring(i);return this._myTokenize(a,t,n+i,r)},e.prototype._myTokenize=function(e,t,n,r){r.enterMode(n,this._modeId);for(var i,o,s=e.length,a=t.embeddedModeData,u=t.stack,l=0,c=null,h=null,d=null,p=null;l=s)break;var D=this._lexer.tokenizer[v];D||(D=TR(this._lexer,v))||LR(this._lexer,"tokenizer state is not defined: "+v);var E=e.substr(l);for(var A in D)if(UR.call(D,A)){var S=D[A];if((0===l||!S.matchOnlyAtLineStart)&&(y=E.match(S.regex))){b=y[0],_=S.action;break}}}for(y||(y=[""],b=""),_||(l=this._lexer.maxStack?LR(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]"):u=u.push(v);else if("@pop"===_.next)u.depth<=1?LR(this._lexer,"trying to pop an empty stack in rule: "+C.name):u=u.pop();else if("@popall"===_.next)u=u.popall();else{var M;"@"===(M=kR(this._lexer,_.next,b,y,v))[0]&&(M=M.substr(1)),TR(this._lexer,M)?u=u.push(M):LR(this._lexer,"trying to set a next state '"+M+"' that is undefined in rule: "+C.name)}_.log&&"string"==typeof _.log&&(i=this._lexer,o=this._lexer.languageId+": "+kR(this._lexer,_.log,b,y,v),console.log(i.languageId+": "+o))}if(null===x&&LR(this._lexer,"lexer rule has no well-defined action in rule: "+C.name),Array.isArray(x)){c&&c.length>0&&LR(this._lexer,"groups cannot be nested: "+C.name),y.length!==x.length+1&&LR(this._lexer,"matched number of groups does not match the number of actions in rule: "+C.name);for(var N=0,I=1;I0&&i[o-1]===c)){var h=l.startIndex;0===a?h=0:h=1&&u.length<=3)if(c.setRegex(i,u[0]),u.length>=3)if("string"==typeof u[1])c.setAction(i,{token:u[1],next:u[2]});else if("object"==typeof u[1]){var h=u[1];h.next=u[2],c.setAction(i,h)}else LR(n,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);else c.setAction(i,u[1]);else u.regex||LR(n,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e),u.name&&(c.name=OR(u.name)),u.matchOnlyAtStart&&(c.matchOnlyAtLineStart=FR(u.matchOnlyAtLineStart)),c.setRegex(i,u.regex),c.setAction(i,u.action);r.push(c)}}}for(r in i.languageId=e,i.ignoreCase=n.ignoreCase,i.noThrow=n.noThrow,i.usesEmbedded=n.usesEmbedded,i.stateNames=t.tokenizer,i.defaultToken=n.defaultToken,t.tokenizer&&"object"==typeof t.tokenizer||LR(n,"a language definition must define the 'tokenizer' attribute as an object"),n.tokenizer=[],t.tokenizer)if(t.tokenizer.hasOwnProperty(r)){n.start||(n.start=r);var s=t.tokenizer[r];n.tokenizer[r]=new Array,o("tokenizer."+r,n.tokenizer[r],s)}n.usesEmbedded=i.usesEmbedded,t.brackets?Array.isArray(t.brackets)||LR(n,"the 'brackets' attribute must be defined as an array"):t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];var a=[];for(var u in t.brackets)if(t.brackets.hasOwnProperty(u)){var l=t.brackets[u];l&&Array.isArray(l)&&3===l.length&&(l={token:l[2],open:l[0],close:l[1]}),l.open===l.close&&LR(n,"open and close brackets in a 'brackets' attribute must be different: "+l.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required."),"string"==typeof l.open&&"string"==typeof l.token?a.push({token:OR(l.token)+n.tokenPostfix,open:NR(n,OR(l.open)),close:NR(n,OR(l.close))}):LR(n,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return n.brackets=a,n.noThrow=!0,n}(e,t),r=function(e,t,n,r){return new GR(e,t,n,r)}(zB.modeService.get(),zB.standaloneThemeService.get(),e,n);return xi.register(e,r)}function rj(e,t){return li.register(e,t)}function ij(e,t){return ci.register(e,t)}function oj(e,t){return di.register(e,t)}function sj(e,t){return pi.register(e,{provideHover:function(e,n,r){var i=e.getWordAtPosition(n);return Ol(t.provideHover(e,n,r)).then(function(e){if(e)return!e.range&&i&&(e.range=new be(n.lineNumber,i.startColumn,n.lineNumber,i.endColumn)),e.range||(e.range=new be(n.lineNumber,n.column,n.lineNumber,n.column)),e})}})}function aj(e,t){return fi.register(e,t)}function uj(e,t){return gi.register(e,t)}function lj(e,t){return mi.register(e,t)}function cj(e,t){return vi.register(e,t)}function hj(e,t){return yi.register(e,t)}function dj(e,t){return bi.register(e,t)}function pj(e,t){return _i.register(e,{provideCodeActions:function(e,n,r,i){var o=zB.markerService.get().read({resource:e.uri}).filter(function(e){return be.areIntersectingOrTouching(e,n)});return t.provideCodeActions(e,n,{markers:o,only:r.only},i)}})}function fj(e,t){return Ci.register(e,t)}function gj(e,t){return wi.register(e,t)}function mj(e,t){return Di.register(e,t)}function vj(e,t){return Ei.register(e,t)}function yj(e,t){var n=new Cj(t);return hi.register(e,{triggerCharacters:t.triggerCharacters,provideCompletionItems:function(e,t,r,i){return n.provideCompletionItems(e,t,r,i)},resolveCompletionItem:function(e,t,r,i){return n.resolveCompletionItem(e,t,r,i)}})}function bj(e,t){return Ai.register(e,t)}function _j(e,t){return Si.register(e,t)}!function(e){e[e.Text=0]="Text",e[e.Method=1]="Method",e[e.Function=2]="Function",e[e.Constructor=3]="Constructor",e[e.Field=4]="Field",e[e.Variable=5]="Variable",e[e.Class=6]="Class",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Unit=10]="Unit",e[e.Value=11]="Value",e[e.Enum=12]="Enum",e[e.Keyword=13]="Keyword",e[e.Snippet=14]="Snippet",e[e.Color=15]="Color",e[e.File=16]="File",e[e.Reference=17]="Reference",e[e.Folder=18]="Folder"}($R||($R={}));var Cj=function(){function e(e){this._provider=e}return e.from=function(e,t,n){var r={_actual:e,label:e.label,insertText:e.label,type:function(e){switch(e){case $R.Method:return"method";case $R.Function:return"function";case $R.Constructor:return"constructor";case $R.Field:return"field";case $R.Variable:return"variable";case $R.Class:return"class";case $R.Interface:return"interface";case $R.Module:return"module";case $R.Property:return"property";case $R.Unit:return"unit";case $R.Value:return"value";case $R.Enum:return"enum";case $R.Keyword:return"keyword";case $R.Snippet:return"snippet";case $R.Text:return"text";case $R.Color:return"color";case $R.File:return"file";case $R.Reference:return"reference";case $R.Folder:return"folder"}return"property"}(e.kind),detail:e.detail,documentation:e.documentation,command:e.command,sortText:e.sortText,filterText:e.filterText,snippetType:"internal",additionalTextEdits:e.additionalTextEdits,commitCharacters:e.commitCharacters},i=e.textEdit?e.textEdit.range:e.range;if(i){if(!(i.startLineNumber===i.endLineNumber)||i.startLineNumber!==t.lineNumber)return console.warn("INVALID range, must be single line and on the same line"),null;r.overwriteBefore=t.column-i.startColumn,r.overwriteAfter=i.endColumn-t.column}else r.overwriteBefore=t.column-n.column,r.overwriteAfter=0;return e.textEdit?r.insertText=e.textEdit.text:"object"==typeof e.insertText&&"string"==typeof e.insertText.value?(r.insertText=e.insertText.value,r.snippetType="textmate"):"string"==typeof e.insertText&&(r.insertText=e.insertText),r},e.prototype.provideCompletionItems=function(t,n,r,i){return Ol(this._provider.provideCompletionItems(t,n,i,r)).then(function(r){var i,o={suggestions:[]},s=n,a=t.getWordUntilPosition(n);if(a&&(s=new ye(s.lineNumber,a.startColumn)),Array.isArray(r))i={items:r,isIncomplete:!1};else if("object"==typeof r&&Array.isArray(r.items))i=r,o.incomplete=i.isIncomplete;else{if(!r)return;console.warn("INVALID result from completion provider. expected CompletionItem-array or CompletionList but got:",r)}for(var u=0;u","delimiter.angle"]],tokenizer:{root:[[/-?[0-9][0-9_]*(\.[0-9_]*)?/,"number"],[/(?:[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21])((?:[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43])|(?:[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21])|[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]|(?:[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F]|\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1])|(?:[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])|[\x2D0-9_])*/,"type.identifier"],[/#((?:[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43])|(?:[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21])|[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]|(?:[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F]|\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1])|(?:[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]))((?:[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43])|(?:[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21])|[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]|(?:[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F]|\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1])|(?:[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])|[\x2D0-9_])*/,"symbol"],[/((?:[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43])|(?:[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21])|[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]|(?:[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F]|\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1])|(?:[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]))((?:[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43])|(?:[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21])|[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]|(?:[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F]|\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0\uDFE1])|(?:[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05EF-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])|[\x2D0-9_])*/,"identifier"],[/[{}()\[\]]/,"@brackets"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/[;].*$/,"comment"],[/((?:[!-#%-'\*,\.\/:;\?@\\\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u2E43-\u2E4E\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F])|(?:[\+<->\|~\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83B[\uDEF0\uDEF1])|[\x2D\^])/,"operator"]],string:[[/[^\\"]+/,"string"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]]}});const Xj=["Shape","Rank","Min","Max","RankUp","Transpose","RandomNormal","RandomUniform"];jj.registerCompletionItemProvider("L1",{provideCompletionItems:()=>[...Xj.map(e=>({label:e,kind:jj.CompletionItemKind.Function,documentation:"mu"})),{label:"ifelse",kind:jj.CompletionItemKind.Snippet,insertText:{value:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n")},documentation:"If-Else Statement"}]});var Jj=i;class $j extends a.PureComponent{constructor(...e){super(...e),d()(this,"container",null),d()(this,"editor",null),d()(this,"decorations",[]),d()(this,"viewZones",[]),d()(this,"markers",[]),d()(this,"issues",new fe),d()(this,"_forced",!1),d()(this,"_mount",async e=>{if(this.container=e,this.container){new ce.a("Fira Code").load().then(this.instantiateEditor,e=>{console.log("Could not load the font")})}}),d()(this,"instantiateEditor",()=>{const e={value:this.props.content,language:this.props.language,theme:"L1",fontFamily:"Fira Code",fontSize:16,fontLigatures:!0,tabSize:this.props.tabSize,readOnly:this.props.readOnly,glyphMargin:!0,lineNumbersMinChars:2,lineDecorationsWidth:0,wordWrap:"bounded",wrappingIndent:"indent",autoIndent:!0,formatOnType:!0,minimap:{enabled:!1},scrollBeyondLastLine:!0,scrollbar:{useShadows:!0,verticalScrollbarSize:5,vertical:"visible",horizontalScrollbarSize:5,horizontal:"hidden"}};this.editor=Jj.editor.create(this.container,e),window.addEventListener("resize",e=>{this.editor.layout()}),this.editor.onDidChangeModelContent(e=>{const t=this.props.onChange;if(ue(t)){const e=this.editor.getValue();this.issues.next(null),t.apply(null,[e,this.editor,this.issues,this._forced])}}),this.editor.addAction({id:"executeCode",label:"Execute Code",keybindings:[Jj.KeyMod.CtrlCmd|Jj.KeyCode.Enter],run:e=>{const t=this.props.onExecute;return ue(t)&&(this.issues.next(null),t.apply(null,[e,this.issues])),null}}),this.editor.addAction({id:"save",label:"Save",keybindings:[Jj.KeyMod.CtrlCmd|Jj.KeyCode.KEY_S],run:e=>{const t=this.props.onSave;return ue(t)&&t(),null}}),this.subscribeToIssues(),this.editor.getAction("executeCode").run()}),d()(this,"setDecorations",e=>{const t=e.map(nz),n=e.map(rz);this.editor.changeViewZones(t=>{this.viewZones.forEach(e=>t.removeZone(e)),this.viewZones=e.map(e=>{const n=document.createElement("div");return this.renderIssue(e,n),t.addZone({afterLineNumber:e.startLineNumber,heightInLines:0,domNode:n})})}),this.decorations=this.editor.deltaDecorations(this.decorations,n),Jj.editor.setModelMarkers(this.editor.getModel(),"test",t)})}subscribeToIssues(){this.issues.pipe(function(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new me(e,t,n))}}((e,t)=>null===t?[]:[...e,t],[])).subscribe(this.setDecorations)}renderIssue(e,t){s.a.render(u.a.createElement(ez,e),t)}setContent(e){this._forced=!0,this.editor.setValue(e),this._forced=!1}render(){return u.a.createElement("div",{className:"editor-container"},u.a.createElement("div",{style:{width:"100%",height:"100%"},ref:this._mount}))}}d()($j,"defaultProps",{onChange:()=>{},onExecute:()=>{},onSave:()=>{},defaultValue:"",language:"L1",readOnly:!1,tabSize:4});const ez=e=>u.a.createElement("div",{className:`message ${e.severity}`},u.a.createElement("span",null,e.message)),tz={error:Jj.Severity.Error,warning:Jj.Severity.Warning,info:Jj.Severity.Info},nz=e=>({startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn,message:e.message,severity:tz[e.severity]}),rz=e=>({range:new Jj.Range(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn),options:{isWholeLine:!0,className:`inlineDecoration ${e.severity}`,glyphMarginClassName:`glyphDecoration ${e.severity}`,glyphMarginHoverMessage:e.message}});var iz=n(50),oz=n.n(iz),sz=n(233),az=n.n(sz),uz=Object.prototype;var lz=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||uz)};var cz=function(e,t){return function(n){return e(t(n))}},hz=cz(Object.keys,Object),dz=Object.prototype.hasOwnProperty;var pz,fz=function(e){if(!lz(e))return hz(e);var t=[];for(var n in Object(e))dz.call(e,n)&&"constructor"!=n&&t.push(n);return t},gz=U.a["__core-js_shared__"],mz=(pz=/[^.]+$/.exec(gz&&gz.keys&&gz.keys.IE_PROTO||""))?"Symbol(src)_1."+pz:"";var vz=function(e){return!!mz&&mz in e},yz=Function.prototype.toString;var bz=function(e){if(null!=e){try{return yz.call(e)}catch(e){}try{return e+""}catch(e){}}return""},_z=/^\[object .+?Constructor\]$/,Cz=Function.prototype,wz=Object.prototype,Dz=Cz.toString,Ez=wz.hasOwnProperty,Az=RegExp("^"+Dz.call(Ez).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Sz=function(e){return!(!re(e)||vz(e))&&(ue(e)?Az:_z).test(bz(e))};var xz=function(e,t){return null==e?void 0:e[t]};var Mz=function(e,t){var n=xz(e,t);return Sz(n)?n:void 0},Nz=Mz(U.a,"DataView"),Iz=Mz(U.a,"Map"),Lz=Mz(U.a,"Promise"),kz=Mz(U.a,"Set"),Tz=Mz(U.a,"WeakMap"),Fz=bz(Nz),Oz=bz(Iz),Pz=bz(Lz),Bz=bz(kz),Rz=bz(Tz),jz=ne;(Nz&&"[object DataView]"!=jz(new Nz(new ArrayBuffer(1)))||Iz&&"[object Map]"!=jz(new Iz)||Lz&&"[object Promise]"!=jz(Lz.resolve())||kz&&"[object Set]"!=jz(new kz)||Tz&&"[object WeakMap]"!=jz(new Tz))&&(jz=function(e){var t=ne(e),n="[object Object]"==t?e.constructor:void 0,r=n?bz(n):"";if(r)switch(r){case Fz:return"[object DataView]";case Oz:return"[object Map]";case Pz:return"[object Promise]";case Bz:return"[object Set]";case Rz:return"[object WeakMap]"}return t});var zz=jz;var Wz=function(e){return null!=e&&"object"==typeof e},Vz="[object Arguments]";var Hz=function(e){return Wz(e)&&ne(e)==Vz},Uz=Object.prototype,Yz=Uz.hasOwnProperty,Zz=Uz.propertyIsEnumerable,Gz=Hz(function(){return arguments}())?Hz:function(e){return Wz(e)&&Yz.call(e,"callee")&&!Zz.call(e,"callee")},Kz=Array.isArray,qz=9007199254740991;var Qz=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=qz};var Xz=function(e){return null!=e&&Qz(e.length)&&!ue(e)},Jz=n(38),$z={};$z["[object Float32Array]"]=$z["[object Float64Array]"]=$z["[object Int8Array]"]=$z["[object Int16Array]"]=$z["[object Int32Array]"]=$z["[object Uint8Array]"]=$z["[object Uint8ClampedArray]"]=$z["[object Uint16Array]"]=$z["[object Uint32Array]"]=!0,$z["[object Arguments]"]=$z["[object Array]"]=$z["[object ArrayBuffer]"]=$z["[object Boolean]"]=$z["[object DataView]"]=$z["[object Date]"]=$z["[object Error]"]=$z["[object Function]"]=$z["[object Map]"]=$z["[object Number]"]=$z["[object Object]"]=$z["[object RegExp]"]=$z["[object Set]"]=$z["[object String]"]=$z["[object WeakMap]"]=!1;var eW=function(e){return Wz(e)&&Qz(e.length)&&!!$z[ne(e)]};var tW=function(e){return function(t){return e(t)}},nW=n(174),rW=nW.a&&nW.a.isTypedArray,iW=rW?tW(rW):eW,oW="[object Map]",sW="[object Set]",aW=Object.prototype.hasOwnProperty;var uW=function(e){if(null==e)return!0;if(Xz(e)&&(Kz(e)||"string"==typeof e||"function"==typeof e.splice||Object(Jz.a)(e)||iW(e)||Gz(e)))return!e.length;var t=zz(e);if(t==oW||t==sW)return!e.size;if(lz(e))return!fz(e).length;for(var n in e)if(aW.call(e,n))return!1;return!0},lW=n(234),cW=n.n(lW);const hW={operation:"eval",actions:{Program:function(e){return c()({},fW(this.source),{type:"Program",value:e.eval()})},Assignment_normal:function(e,t,n,r,i){const o="_"===e.sourceString,s=t.eval(),a=r.eval();return c()({},fW(this.source),{type:"Assignment",path:s,value:a,silent:o})},Assignment_import:function(e,t,n){const r=t.eval();return c()({},fW(this.source),{type:"Assignment",path:c()({},fW(this.source),{type:"Path",value:[r.value.slice(-1).pop()]}),value:c()({},fW(this.source),{type:"Reference",value:r})})},FunctionApplication:function(e,t){return t=t.eval(),e=e.eval(),uW(t)?e:c()({},fW(this.source),{type:"FunctionApplication",direction:"backward",function:e,argument:t[0]})},Pipeline_binary:function(e,t,n){let r=e.eval();return c()({},fW(this.source),{type:"FunctionApplication",direction:"forward",function:n.eval(),argument:r})},Path:function(e){return c()({},fW(this.source),{type:"Path",value:e.eval()})},Function:function(e,t,n){return c()({},fW(this.source),{type:"Function",argument:e.eval(),value:n.eval()})},Object:function(e,t,n){return c()({},fW(this.source),{type:"Object",value:t.eval()})},Matrix:function(e,t,n){return c()({},fW(this.source),{type:"TensorLiteral",rank:2,value:t.eval()})},Vector:function(e,t,n){return c()({},fW(this.source),{type:"TensorLiteral",rank:1,value:t.eval()})},Scalar:function(e){return c()({},fW(this.source),{type:"TensorLiteral",rank:0,value:e.eval()})},Addition_binary:function(e,t,n){return pW(e,t,n,this.source)},Multiplication_binary:function(e,t,n){return pW(e,t,n,this.source)},Exponentiation_binary:function(e,t,n){return pW(e,t,n,this.source)},Access_binary:function(e,t,n){return pW(e,t,n,this.source)},PrimitiveExpression_tensor:function(e){return c()({},fW(this.source),{type:"Tensor",value:e.eval()})},Addition_sum:function(e,t){return dW(e,t,this.source)},Addition_negative:function(e,t){return dW(e,t,this.source)},Multiplication_product:function(e,t){return dW(e,t,this.source)},Multiplication_reciprocal:function(e,t){return dW(e,t,this.source)},PrimitiveExpression_magic:function(e,t){return dW(e,t,this.source)},PrimitiveExpression_paren:function(e,t,n){return t.eval()},PrimitiveExpression_none1:function(e,t){return c()({},fW(this.source),gW)},PrimitiveExpression_none2:function(e){return c()({},fW(this.source),gW)},PrimitiveExpression_emptyTensor:function(e,t){return c()({},fW(this.source),{type:"Tensor",value:{type:"TensorLiteral",rank:0,value:[]}})},Reference:function(e){return c()({},fW(this.source),{type:"Reference",value:e.eval()})},row:function(e,t,n){return t.eval()},rows:function(e){return e.eval()},identifier:function(e,t){return this.sourceString},symbol:function(e,t){return Symbol.for(t.eval())},number:function(e,t,n,r){const i=this.sourceString.replace(/_/g,"");return parseFloat(i,10)},string:function(e,t,n){return c()({},fW(this.source),{type:"String",value:cW()(t.sourceString)})},nonemptyListOf:function(e,t,n){return[e.eval()].concat(n.eval())}}},dW=(e,t,n)=>c()({},fW(n),{type:"Operation",operator:e.sourceString,left:gW,right:t.eval()}),pW=(e,t,n,r)=>c()({},fW(r),{type:"Operation",operator:t.sourceString,left:e.eval(),right:n.eval()}),fW=e=>({_source:yW(e.sourceString,e.startIdx,e.endIdx)}),gW={type:"None"};var mW=hW;var vW=new class{constructor(){d()(this,"grammar",null),d()(this,"semantics",null),d()(this,"parse",(e,t)=>new Promise(n=>{n(this.parseSync(e,t))})),d()(this,"parseSync",(e,t)=>{const n=this.grammar.match(e);if(n.succeeded()){const e=this.semantics(n);return{result:e[mW.operation].call(e)}}{const r=c()({},yW(e,n.getRightmostFailurePosition()),{message:"Expected "+n.getExpectedText(),severity:"error"});return t.next(r),{result:null}}}),this.grammar=oz.a.grammar(az.a),this.semantics=this.grammar.createSemantics().addOperation(mW.operation,mW.actions)}};const yW=(e,t,n)=>{n=n||t;const r=bW(e,t),i=bW(e,n);return{startLineNumber:r.lineNum,startColumn:r.colNum,endLineNumber:i.lineNum,endColumn:i.colNum,_value:e.substring(t,n)}},bW=function(e,t){for(var n=1,r=1,i=0,o=0,s=null,a=null,u=-1;i=0&&(a=e.slice(u,o).replace(/\r?\n$/,"")),{lineNum:n,colNum:r,line:e.slice(o,c).replace(/\r$/,""),prevLine:a,nextLine:s}};var _W=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(L),CW=function(e){function t(t,n,r){var i=e.call(this)||this;return i.parent=t,i.outerValue=n,i.outerIndex=r,i.index=0,i}return g(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(L),wW=function(e){return function(t){return e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,b),t}};var DW=function(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}(),EW=function(e){return function(t){for(var n=e[DW]();;){var r=n.next();if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add(function(){n.return&&n.return()}),t}},AW=function(e){return function(t){var n=e[T]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(t)}},SW=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function xW(e){return e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}var MW=function(e){if(e instanceof P)return function(t){return e._isScalar?(t.next(e.value),void t.complete()):e.subscribe(t)};if(e&&"function"==typeof e[T])return AW(e);if(SW(e))return R(e);if(xW(e))return wW(e);if(e&&"function"==typeof e[DW])return EW(e);var t=w(e)?"an invalid object":"'"+e+"'";throw new TypeError("You provided "+t+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function NW(e,t,n,r){var i=new CW(e,n,r);return MW(t)(i)}var IW={};function LW(){for(var e=[],t=0;t0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):t.flush(this)},t}(function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return g(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(e){n=!0,r=!!e&&e||new Error(e)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(function(e){function t(t,n){return e.call(this)||this}return g(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(M))),WW=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}(),VW=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return g(t,e),t}(function(e){function t(n,r){void 0===r&&(r=WW.now);var i=e.call(this,n,function(){return t.delegate&&t.delegate!==i?t.delegate.now():r()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return g(t,e),t.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),t.delegate&&t.delegate!==this?t.delegate.schedule(n,r,i):e.prototype.schedule.call(this,n,r,i)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(WW)))(zW);function HW(e){var t=e.error;e.subscriber.error(t)}var UW=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e,t;switch(this.kind){case"N":return V(this.value);case"E":return e=this.error,new P(t?function(n){return t.schedule(HW,0,{error:e,subscriber:n})}:function(t){return t.error(e)});case"C":return W()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}();var YW=function(e){function t(t,n,r){void 0===r&&(r=0);var i=e.call(this,t)||this;return i.scheduler=n,i.delay=r,i}return g(t,e),t.dispatch=function(e){var t=e.notification,n=e.destination;t.observe(n),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.add(this.scheduler.schedule(t.dispatch,this.delay,new ZW(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(UW.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(UW.createError(e))},t.prototype._complete=function(){this.scheduleMessage(UW.createComplete())},t}(L),ZW=function(){return function(e,t){this.notification=e,this.destination=t}}(),GW=function(e){function t(t,n,r){void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return g(t,e),t.prototype.nextInfiniteTimeWindow=function(t){var n=this._events;n.push(t),n.length>this._bufferSize&&n.shift(),e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this._events.push(new KW(this._getNow(),t)),this._trimBufferThenGetEvents(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=r.length;if(this.closed)throw new he;if(this.isStopped||this.hasError?t=M.EMPTY:(this.observers.push(e),t=new de(this,e)),i&&e.add(e=new YW(e,i)),n)for(var s=0;st&&(o=Math.max(o,i-t)),o>0&&r.splice(0,o),r},t}(fe),KW=function(){return function(e,t){this.time=e,this.value=t}}();function qW(e,t,n){return function(r){return r.lift(function(e,t,n){var r,i,o=0,s=!1,a=!1;return function(u){o++,r&&!s||(s=!1,r=new GW(e,t,n),i=u.subscribe({next:function(e){r.next(e)},error:function(e){s=!0,r.error(e)},complete:function(){a=!0,r.complete()}}));var l=r.subscribe(this);return function(){o--,l.unsubscribe(),i&&0===o&&a&&i.unsubscribe()}}}(e,t,n))}}function QW(e){return function(t){var n=new XW(e),r=t.lift(n);return n.caught=r}}var XW=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new JW(e,this.selector,this.caught))},e}(),JW=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.selector=n,i.caught=r,i}return g(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle(),this.add(NW(this,n))}},t}(_W);function $W(e,t){if(!t)return e instanceof P?e:new P(MW(e));if(null!=e){if(function(e){return e&&"function"==typeof e[T]}(e))return function(e,t){return new P(t?function(n){var r=new M;return r.add(t.schedule(function(){var i=e[T]();r.add(i.subscribe({next:function(e){r.add(t.schedule(function(){return n.next(e)}))},error:function(e){r.add(t.schedule(function(){return n.error(e)}))},complete:function(){r.add(t.schedule(function(){return n.complete()}))}}))})),r}:AW(e))}(e,t);if(xW(e))return function(e,t){return new P(t?function(n){var r=new M;return r.add(t.schedule(function(){return e.then(function(e){r.add(t.schedule(function(){n.next(e),r.add(t.schedule(function(){return n.complete()}))}))},function(e){r.add(t.schedule(function(){return n.error(e)}))})})),r}:wW(e))}(e,t);if(SW(e))return j(e,t);if(function(e){return e&&"function"==typeof e[DW]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new P(t?function(n){var r,i=new M;return i.add(function(){r&&"function"==typeof r.return&&r.return()}),i.add(t.schedule(function(){r=e[DW](),i.add(t.schedule(function(){if(!n.closed){var e,t;try{var i=r.next();e=i.value,t=i.done}catch(e){return void n.error(e)}t?n.complete():(n.next(e),this.schedule())}}))})),i}:EW(e))}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}var eV=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new tV(e,this.project))},e}(),tV=function(e){function t(t,n){var r=e.call(this,t)||this;return r.project=n,r.index=0,r}return g(t,e),t.prototype._next=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(e){return void this.destination.error(e)}this._innerSub(t,e,n)},t.prototype._innerSub=function(e,t,n){var r=this.innerSubscription;r&&r.unsubscribe(),this.add(this.innerSubscription=NW(this,e,t,n))},t.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.innerSubscription=null},t.prototype.notifyComplete=function(t){this.remove(t),this.innerSubscription=null,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},t}(_W);var nV=function(){this.__data__=[],this.size=0};var rV=function(e,t){return e===t||e!=e&&t!=t};var iV=function(e,t){for(var n=e.length;n--;)if(rV(e[n][0],t))return n;return-1},oV=Array.prototype.splice;var sV=function(e){var t=this.__data__,n=iV(t,e);return!(n<0||(n==t.length-1?t.pop():oV.call(t,n,1),--this.size,0))};var aV=function(e){var t=this.__data__,n=iV(t,e);return n<0?void 0:t[n][1]};var uV=function(e){return iV(this.__data__,e)>-1};var lV=function(e,t){var n=this.__data__,r=iV(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function cV(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e0){if(++t>=LH)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(IH);var OH=function(e,t){return FH(MH(e,t,AH),e+"")};var PH=function(e,t,n){if(!re(n))return!1;var r=typeof t;return!!("number"==r?Xz(n)&&gH(t,n.length):"string"==r&&t in n)&&rV(n[t],e)};var BH=function(e){return OH(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,s&&PH(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++rSymbol.for(e);var pU={meta:dU("meta"),doc:dU("doc"),call:dU("call"),true:dU("true"),false:dU("false")},fU=n(0);Object.prototype.toString;function gU(e,t,n,r){return m(n)&&(r=n,n=void 0),r?gU(e,t,n).pipe(BW(function(e){return C(e)?r.apply(void 0,e):r(e)})):new P(function(r){!function e(t,n,r,i,o){var s;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){var a=t;t.addEventListener(n,r,o),s=function(){return a.removeEventListener(n,r,o)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){var u=t;t.on(n,r),s=function(){return u.off(n,r)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){var l=t;t.addListener(n,r),s=function(){return l.removeListener(n,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var c=0,h=t.length;c1?r.next(Array.prototype.slice.call(arguments)):r.next(e)},r,n)})}var mU={[pU.doc]:"\n# Mouse\nProvides mouse coordinates (`x` and `y`) inside the window.\n\n```L1\nx: Mouse.x\ny: Mouse.y\n```\n",x:gU(window,"mousemove").pipe(BW(e=>tf.scalar(e.x))),y:gU(window,"mousemove").pipe(BW(e=>tf.scalar(e.y)))},vU=n(236),yU=n.n(vU),bU={[Symbol.for("doc")]:yU.a},_U=n(237),CU=n.n(_U);const wU=e=>Array.from(e.dataSync());var DU={RandomNormal:{[pU.doc]:CU.a,[pU.call]:e=>{let t=fU.scalar(1),n=fU.scalar(0),r=fU.scalar(1);if(void 0===e)return V(fU.scalar(wU(fU.randomNormal(wU(t),wU(n)[0],wU(r)[0]))[0]));if(e instanceof fU.Tensor)return t=e,V(fU.randomNormal(wU(t),wU(n)[0],wU(r)[0]));if(!re(e))throw Error("RandomNormal needs tensor or object");if(!e.hasOwnProperty("shape"))throw Error("RandomNormal { shape: ? }");return t=e.shape,e.hasOwnProperty("mean")&&(n=e.mean),e.hasOwnProperty("stdDev")&&(r=e.stdDev),V(fU.randomNormal(wU(t),wU(n)[0],wU(r)[0]))}}},EU=n(238),AU=n.n(EU);const SU=e=>Array.from(e.dataSync());var xU={RandomUniform:{[pU.doc]:AU.a,[pU.call]:e=>{let t=fU.scalar(1),n=fU.scalar(0),r=fU.scalar(1);if(void 0===e)return V(fU.scalar(SU(fU.randomUniform(SU(t),SU(n)[0],SU(r)[0]))[0]));if(e instanceof fU.Tensor)return t=e,V(fU.randomUniform(SU(t),SU(n)[0],SU(r)[0]));if(!re(e))throw Error("RandomUniform needs tensor or object");if(!e.hasOwnProperty("shape"))throw Error("RandomUniform { shape: ? }");return t=e.shape,e.hasOwnProperty("min")&&(n=e.min),e.hasOwnProperty("max")&&(r=e.max),V(fU.randomUniform(SU(t),SU(n)[0],SU(r)[0]))}}},MU=c()({},DU,xU);var NU={RectifiedLinearUnit:{[pU.doc]:"# Rectified Linear Unit\n\nReplaces negative values with zero.\n\n```L1\na: RectifiedLinearUnit [-1 0 1] ; [0 0 1]\n```\n",[pU.call]:e=>V(fU.relu(e))},ExponentialLinearUnit:{[pU.doc]:"# Exponential Linear Unit",[pU.call]:e=>V(fU.elu(e))},ScaledExponentialLinearUnit:{[pU.doc]:"# Scaled Exponential Linear Unit",[pU.call]:e=>V(fU.selu(e))},Sigmoid:{[pU.doc]:"# Sigmoid",[pU.call]:e=>V(fU.sigmoid(e))},Softmax:{[pU.doc]:"# Softmax",[pU.call]:e=>V(fU.softmax(e))},Softplus:{[pU.doc]:"# Softplus",[pU.call]:e=>V(fU.softplus(e))}},IU={Sine:e=>V(fU.sin(e)),Cosine:e=>V(fU.cos(e)),Tangent:e=>V(fU.tan(e)),ArcusSine:e=>V(fU.asin(e)),ArcusCosine:e=>V(fU.acos(e)),ArcusTangent:e=>V(fU.atan(e))},LU=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function kU(e,t){function n(){this.constructor=e}LU(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var TU=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]t?1:0}(e,t)}function sY(e){if(null==e)return e;for(var t=[],n=0,r=e;n=0),XU(r>=n),Array.isArray(e)&&e.length>=n&&e.length<=r&&e.every(function(e){return typeof e===t})}function cY(e,t){return Object(fU.tidy)(function(){return Object(fU.sqrt)(Object(fU.sum)(Object(fU.mulStrict)(e,e),t,!0))})}var hY=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return kU(t,e),t.prototype.getConfig=function(){return{}},t}(fU.serialization.Serializable),dY=function(e){function t(t){var n=e.call(this)||this;return n.defaultMaxValue=2,n.defaultAxis=0,n.maxValue=null!=t.maxValue?t.maxValue:n.defaultMaxValue,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return kU(t,e),t.prototype.apply=function(e){var t=this;return Object(fU.tidy)(function(){var n=cY(e,t.axis),r=Object(fU.clipByValue)(n,0,t.maxValue);return Object(fU.mul)(e,Object(fU.div)(r,Object(fU.add)(UU(BU()),n)))})},t.prototype.getConfig=function(){return{maxValue:this.maxValue,axis:this.axis}},t.className="MaxNorm",t}(hY);fU.serialization.SerializationMap.register(dY);var pY=function(e){function t(t){var n=e.call(this)||this;return n.defaultAxis=0,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return kU(t,e),t.prototype.apply=function(e){var t=this;return Object(fU.tidy)(function(){return Object(fU.div)(e,Object(fU.add)(UU(BU()),cY(e,t.axis)))})},t.prototype.getConfig=function(){return{axis:this.axis}},t.className="UnitNorm",t}(hY);fU.serialization.SerializationMap.register(pY);var fY=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return kU(t,e),t.prototype.apply=function(e){return Object(fU.relu)(e)},t.className="NonNeg",t}(hY);fU.serialization.SerializationMap.register(fY);var gY=function(e){function t(t){var n=e.call(this)||this;return n.defaultMinValue=0,n.defaultMaxValue=1,n.defaultRate=1,n.defaultAxis=0,n.minValue=null!=t.minValue?t.minValue:n.defaultMinValue,n.maxValue=null!=t.maxValue?t.maxValue:n.defaultMaxValue,n.rate=null!=t.rate?t.rate:n.defaultRate,n.axis=null!=t.axis?t.axis:n.defaultAxis,n}return kU(t,e),t.prototype.apply=function(e){var t=this;return Object(fU.tidy)(function(){var n=cY(e,t.axis),r=Object(fU.add)(Object(fU.mul)(UU(t.rate),Object(fU.clipByValue)(n,t.minValue,t.maxValue)),Object(fU.mul)(UU(1-t.rate),n));return Object(fU.mul)(e,Object(fU.div)(r,Object(fU.add)(UU(BU()),n)))})},t.prototype.getConfig=function(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}},t.className="MinMaxNorm",t}(hY);fU.serialization.SerializationMap.register(gY);var mY={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function vY(e){return rY(e)}function yY(e,t){return void 0===t&&(t={}),iY(e,fU.serialization.SerializationMap.getMap().classNameMap,t,"constraint")}function bY(e){return null==e?null:"string"==typeof e?yY({className:e in mY?mY[e]:e,config:{}}):e instanceof hY?e:yY(e)}Object.freeze({maxNorm:function(e){return new dY(e)},unitNorm:function(e){return new pY(e)},nonNeg:function(){return new fY},minMaxNorm:function(e){return new gY(e)}});var _Y=new Map,CY=["channelsFirst","channelsLast"];function wY(e){uY(CY,"DataFormat",e)}var DY=["valid","same","causal"];function EY(e){uY(DY,"PaddingMode",e)}var AY=["max","avg"];var SY=[],xY="/";function MY(e,t){SY.push(e);try{var n=t();return SY.pop(),n}catch(e){throw SY.pop(),e}}function NY(e){if(!kY(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===SY.length?"":SY.join(xY)+xY)+e}function IY(e){if(!kY(e))throw new Error("Not a valid tensor name: '"+e+"'");_Y.has(e)||_Y.set(e,0);var t=_Y.get(e);if(_Y.set(e,_Y.get(e)+1),t>0){var n=e+"_"+t;return _Y.set(n,1),n}return e}var LY=new RegExp(/^[A-Za-z][A-Za-z0-9\._\/]*$/);function kY(e){return!!e.match(LY)}function TY(e){return e===parseInt(e.toString(),10)}function FY(e,t,n){null==t&&(t=0),null==n&&(n=e.length);for(var r=1,i=t;i2e3&&console.warn("Orthogonal initializer is being called on a matrix with more than 2000 ("+e[0]*e[1]+") elements: Slowness may result.");var t=GY(e[0]>e[1]?[e[1],e[0]]:e,0,1,"float32"),r=fU.linalg.gramSchmidt(t);return e[0]>e[1]&&(r=r.transpose()),Object(fU.mul)(UU(n.gain),r)})},t.prototype.getConfig=function(){return{gain:this.gain,seed:this.seed}},t.className="Orthogonal",t}(nZ);fU.serialization.SerializationMap.register(gZ);var mZ={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",identity:"Identity",leCunNormal:"LeCunNormal",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function vZ(e,t){return void 0===t&&(t={}),iY(e,fU.serialization.SerializationMap.getMap().classNameMap,t,"initializer")}function yZ(e){return rY(e)}function bZ(e){if("string"==typeof e){var t=e in mZ?mZ[e]:e;return"GlorotUniform"===t?new hZ:"GlorotNormal"===t?new dZ:"HeNormal"===t?new pZ:"LeCunNormal"===t?new fZ:vZ({className:t,config:{}})}return e instanceof nZ?e:vZ(e)}Object.freeze({zeros:function(){return new rZ},ones:function(){return new iZ},constant:function(e){return new oZ(e)},randomUniform:function(e){return new sZ(e)},randomNormal:function(e){return new aZ(e)},truncatedNormal:function(e){return new uZ(e)},identity:function(e){return new lZ(e)},varianceScaling:function(e){return new cZ(e)},glorotUniform:function(e){return new hZ(e)},glorotNormal:function(e){return new dZ(e)},heNormal:function(e){return new pZ(e)},leCunNormal:function(e){return new fZ(e)},orthogonal:function(e){return new gZ(e)}});function _Z(e){return Array.isArray(e)&&Array.isArray(e[0])}function CZ(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function wZ(e){var t;if(Array.isArray(e)){if(1!==e.length)throw new GU("Expected Tensor length to be 1; got "+e.length);t=e[0]}else t=e;return t}function DZ(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return(e=e)[0];throw new GU("Expected exactly 1 Shape; got "+e.length)}return e}function EZ(e){for(var t=0,n=0,r=e;n1)throw new YU("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer input" is ill-defined. Use `getInputAt(nodeIndex)` instead.');if(0===this.inboundNodes.length)throw new YU("Layer "+this.name+" is not connected, no input to return.");return $U(this.getNodeAtIndex(0,"input").inputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"output",{get:function(){if(0===this.inboundNodes.length)throw new YU("Layer "+this.name+" has no inbound nodes.");if(this.inboundNodes.length>1)throw new YU("Layer "+this.name+' has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use `getOutputAt(nodeIndex)` instead.');return $U(this.getNodeAtIndex(0,"output").outputTensors)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"losses",{get:function(){return this._losses},enumerable:!0,configurable:!0}),t.prototype.calculateLosses=function(){return this.losses.map(function(e){return e()})},Object.defineProperty(t.prototype,"updates",{get:function(){return this._updates},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"built",{get:function(){return this._built},set:function(e){this._built=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.trainable?this._trainableWeights:[]},set:function(e){this._trainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this._nonTrainableWeights:this._trainableWeights.concat(this._nonTrainableWeights)},set:function(e){this._nonTrainableWeights=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"weights",{get:function(){return this.trainableWeights.concat(this.nonTrainableWeights)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stateful",{get:function(){return this._stateful},enumerable:!0,configurable:!0}),t.prototype.assertInputCompatibility=function(e){if(e=eY(e),null!=this.inputSpec&&0!==this.inputSpec.length){var t=eY(this.inputSpec);if(e.length!==t.length)throw new GU("Layer "+this.name+" expects "+t.length+" inputs, but it received "+e.length+" input tensors. Input received: "+e);for(var n=0;n=0?s[u]:s[s.length+u];if(null!=l&&-1===[l,null].indexOf(c))throw new GU("Input "+n+" is incompatible with layer "+this.name+": expected axis "+u+" of input shape to have value "+l+" but got shape "+s+".")}}if(null!=i.shape)for(var h=0;h0&&Array.isArray(f[0])?f.map(function(r,i){return new IZ(m,r,n,eY(e),t,n.name,i)}):new IZ(m,f,n,eY(e),t,n.name),n.addInboundNode(e,g,null,null,p,f,t),null!=n.activityRegularizer)throw new KU("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return g})},t.prototype.warnOnIncompatibleInputShape=function(e){if(null!=this.batchInputShape)if(e.length!==this.batchInputShape.length)console.warn("The rank of the input tensor provided (shape: "+JSON.stringify(e)+") does not match that of the batchInputShape ("+JSON.stringify(this.batchInputShape)+") of the layer "+this.name);else{var t=!1;this.batchInputShape.forEach(function(n,r){null!=n&&null!=e[r]&&e[r]!==n&&(t=!0)}),t&&console.warn("The shape of the input tensor ("+JSON.stringify(e)+") does not match the expectation of layer "+this.name+": "+JSON.stringify(this.batchInputShape))}},Object.defineProperty(t.prototype,"outputShape",{get:function(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new YU("The layer "+this.name+" has never been called and thus has no defined output shape.");for(var e=[],t=0,n=this.inboundNodes;t0&&(r=r.slice(0,r.length-1)+" "),r=(r+=e[i]).slice(0,t[i]),r+=" ".repeat(t[i]-r.length);n(r)}function bG(e,t,n){var r;try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}yG([e.name+" ("+e.getClassName()+")",r,e.countParams().toString()],t,n)}function _G(e,t,n,r){var i;try{i=JSON.stringify(e.outputShape)}catch(e){i="multiple"}for(var o=[],s=0,a=e.inboundNodes;s0&&-1===n.indexOf(u)))for(var l=0;l1 nodes"),XU(0===l,"input layer has >1 tensors"),r.inputLayers.push(a),r.inputLayersNodeIndices.push(u),r.inputLayersTensorIndices.push(l);r.inputNames=[],r.outputNames=[],r.feedInputShapes=[],r.feedInputNames=[],r.feedOutputNames=[];for(var d=0;d=0;)i.splice(i.indexOf(u),1);_.push(u)}},w=[],D=[],E=0,A=r.outputs;Er?1:0});for(var V=0,H=W;V0)throw new GU("Container instance unexpectedly contains _trainableWeights.The trainable weights of a Container are a union of the trainable weights of its consituent Layers. Its own _trainableWeights must remain an empty Array.");if(!this.trainable)return[];for(var e=[],t=0,n=this.layers;t0)throw new GU(h.length+" of "+r+" weights are not set: "+h);MZ(l)}(e,this.layers):function(e,t,n){void 0===n&&(n=!1);for(var r=e.keras_version,i=(e.backend,t.map(function(e){return e.name})),o={},s=0,a=t;s1)for(var a=0,u=s;a0){for(var p=[],f=0;f0&&e.apply($U(o),r)}function s(e){var r=e.name,o=CG(e,null!=t.customObjects?t.customObjects:{});n[r]=o;for(var s=0,a=e.inboundNodes;s0)o=!0;else if(kG(e)){for(var s in e)if(e.hasOwnProperty(s)){o=!0;break}}else o=!0;if(o)throw new GU("Error when checking model "+i+" expected no data, but got "+e)}return[]}if(null==e)return t.map(function(e){return null});var a;if(kG(e)){e=e,a=[];for(var u=0,l=t;u1)throw new GU("The model "+i+" expects "+t.length+" Tensor(s), but only received one Tensor. Found: Tensor with shape "+e.shape);a=[e]}for(var h=0;h=0&&f!==g)throw new GU("Error when checking "+i+": expected "+t[h]+" to have shape ["+n[h]+"], but got array with shape ["+d.shape+"].")}}return a}function FG(e,t){for(var n=[],r=0,i=null;r=e&&(i=e),n.push([r,i]),r=i;return n}function OG(e,t,n){return null==e?[null]:Array.isArray(e)?e.map(function(e){return WY(e,t,n-t)}):WY(e,t,n-t)}function PG(e,t){return Object(fU.tidy)(function(){return null==e?null:Array.isArray(e)?e.map(function(e){return PG(e,t)}):qY(e,"int32"===t.dtype?t:t.toInt())})}function BG(e,t,n,r,i){var o;if(void 0===r&&(r=!0),void 0===i&&(i=""),Array.isArray(e)){if(e.length!==t.length)throw new GU("Error when checking model "+i+": the Array of Tensors that you are passing to your model is not the size the the model expected. Expected to see "+t.length+" Tensor(s), but instead got "+e.length+" Tensors(s).");o=e}else{if(t.length>1)throw new GU("The model expects "+t.length+" "+i+" Tensors, but only received one Tensor. Found: array with shape "+JSON.stringify(e.shape)+".");o=[e]}if(null!=n)for(var s=0;s1||1===a.length&&a[0].inboundLayers.length>1){t=!1;break}r.push.apply(r,a)}if(t)for(var u=0,l=e.layers;u1&&(t.metricsTensors.push([n,e]),t.metricsNames.push(t.outputNames[e]+"_loss"))}});var h=function(e,t){if(null==e||Array.isArray(e)&&0===e.length)return t.map(function(e){return[]});if(Array.isArray(e))return t.map(function(t){return e});if(null!=e){for(var n=[],r=0,i=t;r1&&(n=t.outputNames[e]+"_"+n),t.metricsNames.push(n),t.metricsTensors.push([r,e])}(e,r,l)},a=0,u=h[e];a0){var c=[];throw t.forEach(function(t,n){null==t&&c.push(e[n])}),new GU("Cannot find SymbolicTensors for output name(s): "+JSON.stringify(c))}return t},t.prototype.predictLoop=function(e,t,n){var r=this;return void 0===t&&(t=32),void 0===n&&(n=!1),Object(fU.tidy)(function(){var i=r.checkNumSamples(e);if(n)throw new KU("Verbose predictLoop() is not implemented yet.");for(var o=FG(i,t),s=[],a=function(t){var n=Object(fU.tidy)(function(){var n=o[t][0],i=o[t][1],s=OG(e,n,i),a=[];if(Array.isArray(s))for(var u=0;u1)throw new GU("All input Tensors (x) should have the same number of samples. Got array shapes: "+JSON.stringify(e.map(function(e){return e.shape})));if(i.length>1)throw new GU("All target Tensors (y) should have the same number of samples. Got array shapes: "+JSON.stringify(t.map(function(e){return e.shape})));if(r.length>0&&i.length>0&&!fU.util.arraysEqual(r,i))throw new GU("Input Tensors should have the same number of samples as target Tensors. Found "+r[0]+" input sample(s) and "+i[0]+" target sample(s).")}(e=TG(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=TG(t,this.feedOutputNames,i,!1,"target")),function(e,t,n){for(var r=[UZ,eG,JZ],i=0;i0&&e[0].shape[0]%r!=0)throw new GU("In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size "+r+". Found: "+e[0].shape[0]+" sample(s).");return[e,t,null]},t.prototype.fitLoop=function(e,t,n,r,i,o,s,a,u,l,c,h,d,p){return FU(this,void 0,void 0,function(){var f,g,m,v,y,b,_,C=this;return OU(this,function(w){switch(w.label){case 0:if(null==r&&(r=32),null==i&&(i=1),null==l&&(l=!0),null==h&&(h=0),f=!1,null!=a&&null!=u&&(f=!0),null!=p&&(f=!0,null==d))throw new GU("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");if(null!=(g=this.checkNumSamples(t,r,d,"steps_per_epoch"))&&(m=RY(0,g)),this.history=new WZ,s=(s=null==s?[new zZ]:[new zZ].concat(s)).concat([this.history]),o>0)throw new KU("Verbose mode is not implemented yet.");return(v=new jZ(s)).setModel(this),v.setParams({epochs:i,initialEpoch:h,steps:d,verbose:o,doValidation:f,metrics:c}),[4,v.onTrainBegin()];case 1:w.sent(),this.stopTraining=!1,y=function(i){var o,s,c,h,p;return OU(this,function(y){switch(y.label){case 0:return[4,v.onEpochBegin(i)];case 1:if(y.sent(),o={},null==d)return[3,2];throw new KU("stepsPerEpoch mode is not implemented yet.");case 2:if("batch"===l)throw new KU("batch shuffling is not implemneted yet");l&&fU.util.shuffle(m),s=Object(fU.tensor1d)(m),c=FG(g,r),h=function(i){var l;return OU(this,function(h){switch(h.label){case 0:return l={},[4,v.onBatchBegin(i,l)];case 1:return h.sent(),Object(fU.tidy)(function(){var h=c[i][0],d=c[i][1],p=WY(s,h,d-h);l.batch=i,l.size=d-h;for(var g=PG(t,p),m=e(g),v=0;v1&&(i+="_"+JU(e.slice(0,n),r)),t.push(i)}return t},t.prototype.makeTestFunction=function(){var e=this;this.testFunction=function(t){return Object(fU.tidy)(function(){for(var n,r=[],i=t.slice(0,e.inputs.length),o=t.slice(e.inputs.length,e.inputs.length+e.outputs.length),s=[],a=0;a0){if(a=!0,2!==n.validationData.length)throw 3===n.validationData.length?new KU("validationData including sample weights is not supported yet."):new GU("When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; "+n.validationData+" is invalid.");u=n.validationData[0],l=n.validationData[1],d=this.standardizeUserData(u,l,!0,r),u=d[0],l=d[1],c=u.concat(l)}else null!=n.validationSplit&&n.validationSplit>0&&n.validationSplit<1?(a=!0,p=Math.floor(o[0].shape[0]*(1-n.validationSplit)),f=o[0].shape[0],u=OG(o,p,f),o=OG(o,0,p),l=OG(s,p,f),s=OG(s,0,p),h=!0,c=u.concat(l)):null!=n.validationSteps&&(a=!0);return g=o.concat(s),this.checkTrainableWeightsConsistency(),m=function(e){var t=e.slice(0,w.inputs.length),n=e.slice(w.inputs.length,w.inputs.length+w.outputs.length),r=[],i=w.collectedTrainableWeights.map(function(e){return e.read()});return[w.optimizer.minimize(function(){for(var e=[],i=0;i1)throw new GU("Found more than one ("+n.length+") save handlers for URL '"+e+"'");e=n[0]}if(null==e.save)throw new GU("Model.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return[4,fU.io.encodeWeights(this.getNamedWeights(t))];case 1:return r=a.sent(),i=!1,o=null,s=this.toJSON(o,i),[2,e.save({modelTopology:s,weightData:r.data,weightSpecs:r.specs})]}})})},t.className="Model",t}(AG);fU.serialization.SerializationMap.register(RG);var jG=function(e){function t(t){var n=e.call(this,{inputs:[],outputs:[]})||this;if(t=t||{},n.trainable=!0,n._updatable=!0,n.built=!1,n.name=null!=t.name?t.name:WU("sequential_"),null!=t.layers)for(var r=0,i=t.layers;r0)&&(n=t.sourceLayer,r=t.nodeIndex),0===n.inboundNodes.length)return[t];var i=n.inboundNodes[r];if(0===i.inboundLayers.length)return i.inputTensors;for(var o=[],s=0;s 0 but got "+JSON.stringify(e.filters))},t}(gK),vK=function(e){function t(n){var r=e.call(this,2,n)||this;return t.verifyConfig(n),r}return kU(t,e),t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.rank,t},t.verifyConfig=function(e){if("number"!=typeof e.kernelSize&&!lY(e.kernelSize,"number",1,2))throw new GU("Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received "+JSON.stringify(e.kernelSize)+".")},t.className="Conv2D",t}(mK);fU.serialization.SerializationMap.register(vK);var yK=function(e){function t(t){var n=e.call(this,t)||this;if(n.inputSpec=[new NZ({ndim:4})],"same"!==n.padding&&"valid"!==n.padding)throw new GU("Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode "+n.padding);return n}return kU(t,e),t.prototype.build=function(e){if(4!==(e=DZ(e)).length)throw new GU("Input should have rank 4; Received input shape: "+JSON.stringify(e));var t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new GU("The channel dimension of the inputs should be defined. Found `None`.");var n,r=e[t],i=this.kernelSize.concat([this.filters,r]);this.kernel=this.addWeight("kernel",i,"float32",this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.useBias&&(this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint)),this.inputSpec=[new NZ({ndim:4,axes:(n={},n[t]=r,n)})],this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(fU.tidy)(function(){var t=wZ(e);if(4!==t.shape.length)throw new GU("Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-"+t.shape.length);var r,i,o=t.shape,s=o[0];"channelsFirst"===n.dataFormat?(r=2,i=3):(r=1,i=2);var a=o[r],u=o[i],l=n.kernelSize[0],c=n.kernelSize[1],h=n.strides[0],d=n.strides[1],p=[s,pK(a,h,l,n.padding),pK(u,d,c,n.padding),n.filters];"channelsLast"!==n.dataFormat&&(t=Object(fU.transpose)(t,[0,2,3,1]));var f=Object(fU.conv2dTranspose)(t,n.kernel.read(),p,n.strides,n.padding);return"channelsLast"!==n.dataFormat&&(f=Object(fU.transpose)(f,[0,3,1,2])),null!=n.bias&&(f=XY(f,n.bias.read(),n.dataFormat)),null!=n.activation&&(f=n.activation.apply(f)),f})},t.prototype.computeOutputShape=function(e){var t,n,r,i=(e=DZ(e)).slice();"channelsFirst"===this.dataFormat?(t=1,n=2,r=3):(t=3,n=1,r=2);var o=this.kernelSize[0],s=this.kernelSize[1],a=this.strides[0],u=this.strides[1];return i[t]=this.filters,i[n]=pK(i[n],a,o,this.padding),i[r]=pK(i[r],u,s,this.padding),i},t.prototype.getConfig=function(){var t=e.prototype.getConfig.call(this);return delete t.dilationRate,t},t.className="Conv2DTranspose",t}(vK);fU.serialization.SerializationMap.register(yK);var bK=function(e){function t(t){return e.call(this,2,t)||this}return kU(t,e),t.className="SeparableConv2D",t}(function(e){function t(t,n){var r=e.call(this,t,n)||this;if(r.DEFAULT_DEPTHWISE_INITIALIZER="glorotUniform",r.DEFAULT_POINTWISE_INITIALIZER="glorotUniform",r.depthwiseKernel=null,r.pointwiseKernel=null,null==n.filters)throw new GU("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=n.kernelInitializer||null!=n.kernelRegularizer||null!=n.kernelConstraint)throw new GU("Fields kernelInitializer, kernelRegularizer and kernelConstraint are invalid for SeparableConv2D. Use depthwiseInitializer, depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, pointwiseRegularizer and pointwiseConstraint instead.");if(null!=n.padding&&"same"!==n.padding&&"valid"!==n.padding)throw new GU("SeparableConv"+r.rank+"D supports only padding modes: 'same' and 'valid', but received "+JSON.stringify(n.padding));return r.depthMultiplier=null==n.depthMultiplier?1:n.depthMultiplier,r.depthwiseInitializer=bZ(n.depthwiseInitializer||r.DEFAULT_DEPTHWISE_INITIALIZER),r.depthwiseRegularizer=cK(n.depthwiseRegularizer),r.depthwiseConstraint=bY(n.depthwiseConstraint),r.pointwiseInitializer=bZ(n.depthwiseInitializer||r.DEFAULT_POINTWISE_INITIALIZER),r.pointwiseRegularizer=cK(n.pointwiseRegularizer),r.pointwiseConstraint=bY(n.pointwiseConstraint),r}return kU(t,e),t.prototype.build=function(e){if((e=DZ(e)).length1)throw new GU("Can not merge tensors with different batch sizes. Got tensors with shapes: "+JSON.stringify(e)+".");for(var i=null==e[0]?null:e[0].slice(1),o=1;o1){var v=RY(1,a).concat([0]);t.push(Object(fU.transpose)(d,v)),l=!0}else t.push(d)}var y=n.mergeFunction(t),b=y.rank;if(l)if(null==b){var _=y.shape;g=[f=_[_.length-1]].concat(_.slice(0,_.length-1)),y=Object(fU.transpose)(y.reshape([-1,f]),[1,0]).reshape(g)}else b>1&&(v=[b-1].concat(RY(0,b-1)),y=Object(fU.transpose)(y,v));return y}return n.mergeFunction(e)})},t.prototype.computeOutputShape=function(e){var t;t=null==(e=e)[0]?null:e[0].slice(1);for(var n=1;n1)throw new GU("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}},t.prototype.mergeFunction=function(e){var t=this;return Object(fU.tidy)(function(){return UY(e,t.axis)})},t.prototype.computeOutputShape=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new GU("A `Concatenate` layer should be called on a list of inputs.");for(var t=e,n=t[0].slice(),r=this.axis<0?n.length+this.axis:this.axis,i=0,o=t.slice(1);i=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new GU("Axis "+t+" of input tensor should have a defined dimension but the layer received an input with shape "+JSON.stringify(e)+".");this.inputSpec=[new NZ({ndim:e.length,axes:(r={},r[t]=n,r)})];var r,i=[n];this.scale&&(this.gamma=this.addWeight("gamma",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",i,null,this.movingVarianceInitializer,null,!1),this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(fU.tidy)(function(){var r=null!=t.training&&t.training,i=wZ(e),o=i.shape,s=o.length,a=RY(0,s),u=n.axis>=0?n.axis:n.axis+s;a.splice(u,1);var l=QU(1,s);l[u]=o[u];var c=a.slice();c.sort();var h=!fU.util.arraysEqual(c,RY(0,s).slice(0,s-1));if(!r)return function(){if(h){var e=n.movingMean.read().reshape(l),t=n.movingVariance.read().reshape(l),r=n.center?n.beta.read().reshape(l):null,o=n.scale?n.gamma.read().reshape(l):null;return RK(i,e,t,r,o,n.epsilon)}return RK(i,n.movingMean.read(),n.movingVariance.read(),null==n.beta?null:n.beta.read(),null==n.gamma?null:n.gamma.read(),n.epsilon)}();var d=jK(i,n.gamma.read(),n.beta.read(),a,n.epsilon),p=d[0],f=d[1],g=d[2],m=FY(a.map(function(e){return i.shape[e]})),v=g.mul(UU(m/(m-(1+n.epsilon))));return function(){n.stepCount++;var e=Object(fU.movingAverage)(n.movingMean.read(),f,n.momentum,n.stepCount);n.movingMean.write(e);var t=Object(fU.movingAverage)(n.movingVariance.read(),v,n.momentum,n.stepCount);n.movingVariance.write(t)}(),p})},t.prototype.getConfig=function(){var t={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:yZ(this.betaInitializer),gammaInitializer:yZ(this.gammaInitializer),movingMeanInitializer:yZ(this.movingMeanInitializer),movingVarianceInitializer:yZ(this.movingVarianceInitializer),betaRegularizer:uK(this.betaRegularizer),gammaRegularizer:uK(this.gammaRegularizer),betaConstraint:vY(this.betaConstraint),gammaConstraint:vY(this.gammaConstraint)},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="BatchNormalization",t}(FZ);fU.serialization.SerializationMap.register(zK);var WK=function(e){function t(t){var n=this;if(null==t&&(t={}),(n=e.call(this,t)||this).dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,null==t.padding)n.padding=[[1,1],[1,1]];else if("number"==typeof t.padding)n.padding=[[t.padding,t.padding],[t.padding,t.padding]];else{if(t.padding=t.padding,2!==t.padding.length)throw new GU("ZeroPadding2D expects padding to be a length-2 array, but received a length-"+t.padding.length+" array.");var r=void 0,i=void 0;if("number"==typeof t.padding[0])r=[t.padding[0],t.padding[0]],i=[t.padding[1],t.padding[1]];else{if(t.padding=t.padding,2!==t.padding[0].length)throw new GU("ZeroPadding2D expects height padding to be a length-2 array, but received a length-"+t.padding[0].length+" array.");if(r=t.padding[0],2!==t.padding[1].length)throw new GU("ZeroPadding2D expects width padding to be a length-2 array, but received a length-"+t.padding[1].length+" array.");i=t.padding[1]}n.padding=[r,i]}return n.inputSpec=[new NZ({ndim:4})],n}return kU(t,e),t.prototype.computeOutputShape=function(e){var t,n;return e=DZ(e),"channelsFirst"===this.dataFormat?(t=null!=e[2]&&e[2]>=0?e[2]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[3]&&e[3]>=0?e[3]+this.padding[1][0]+this.padding[1][1]:null,[e[0],e[1],t,n]):(t=null!=e[1]&&e[1]>=0?e[1]+this.padding[0][0]+this.padding[0][1]:null,n=null!=e[2]&&e[2]>=0?e[2]+this.padding[1][0]+this.padding[1][1]:null,[e[0],t,n,e[3]])},t.prototype.call=function(e,t){var n=this;return Object(fU.tidy)(function(){return function(e,t,n){return Object(fU.tidy)(function(){if(4!==e.rank)throw new GU("temporalPadding expects input tensor to be 4-D, but received a "+e.rank+"-D tensor.");if(null==t&&(t=[[1,1],[1,1]]),2!==t.length||2!==t[0].length||2!==t[1].length)throw new GU("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==n&&(n="channelsLast"),"channelsLast"!==n&&"channelsFirst"!==n)throw new GU("Unknown data format: "+n+". Supported data formats are 'channelsLast' and 'channelsFirst.");var r;return r="channelsFirst"===n?[[0,0],[0,0],t[0],t[1]]:[[0,0],t[0],t[1],[0,0]],Object(fU.pad)(e,r)})}(wZ(e),n.padding,n.dataFormat)})},t.prototype.getConfig=function(){var t={padding:this.padding,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t.className="ZeroPadding2D",t}(FZ);function VK(e,t,n,r,i,o){return Object(fU.tidy)(function(){var s;wY(i),function(e){uY(AY,"PoolMode",e)}(o),EY(r),null==n&&(n=[1,1]),null==r&&(r="valid"),null==i&&(i="channelsLast"),null==o&&(o="max"),e=fK(e,i);var a="same"===r?"same":"valid";return s="max"===o?Object(fU.maxPool)(e,t,n,a):Object(fU.avgPool)(e,t,n,a),"channelsFirst"===i&&(s=Object(fU.transpose)(s,[0,3,1,2])),s})}fU.serialization.SerializationMap.register(WK);var HK=function(e){function t(t){var n=this;if(null==t.poolSize&&(t.poolSize=2),n=e.call(this,t)||this,"number"==typeof t.poolSize)n.poolSize=[t.poolSize];else{if(!Array.isArray(t.poolSize)||1!==t.poolSize.length||"number"!=typeof t.poolSize[0])throw new GU("poolSize for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(t.poolSize));n.poolSize=t.poolSize}if(null==t.strides)n.strides=n.poolSize;else if("number"==typeof t.strides)n.strides=[t.strides];else{if(!Array.isArray(t.strides)||1!==t.strides.length||"number"!=typeof t.strides[0])throw new GU("strides for 1D convolutional layer must be a number or an Array of a single number, but received "+JSON.stringify(t.strides));n.strides=t.strides}return n.padding=null==t.padding?"valid":t.padding,EY(n.padding),n.inputSpec=[new NZ({ndim:3})],n}return kU(t,e),t.prototype.computeOutputShape=function(e){var t=dK((e=DZ(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]},t.prototype.call=function(e,t){var n=this;return Object(fU.tidy)(function(){n.invokeCallHook(e,t),e=zY(wZ(e),2);var r=n.poolingFunction(wZ(e),[n.poolSize[0],1],[n.strides[0],1],n.padding,"channelsLast");return Object(fU.squeeze)(r,[2])})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(FZ),UK=function(e){function t(t){return e.call(this,t)||this}return kU(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return wY(i),EY(r),VK(e,t,n,r,i,"max")},t.className="MaxPooling1D",t}(HK);fU.serialization.SerializationMap.register(UK);var YK=function(e){function t(t){return e.call(this,t)||this}return kU(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return wY(i),EY(r),VK(e,t,n,r,i,"avg")},t.className="AveragePooling1D",t}(HK);fU.serialization.SerializationMap.register(YK);var ZK=function(e){function t(t){var n=this;if(null==t.poolSize&&(t.poolSize=[2,2]),(n=e.call(this,t)||this).poolSize=Array.isArray(t.poolSize)?t.poolSize:[t.poolSize,t.poolSize],null==t.strides)n.strides=n.poolSize;else if(Array.isArray(t.strides)){if(2!==t.strides.length)throw new GU("If the strides property of a 2D pooling layer is an Array, it is expected to have a length of 2, but received length "+t.strides.length+".");n.strides=t.strides}else n.strides=[t.strides,t.strides];return n.padding=null==t.padding?"valid":t.padding,n.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,wY(n.dataFormat),EY(n.padding),n.inputSpec=[new NZ({ndim:4})],n}return kU(t,e),t.prototype.computeOutputShape=function(e){e=DZ(e);var t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=dK(t,this.poolSize[0],this.padding,this.strides[0]),n=dK(n,this.poolSize[1],this.padding,this.strides[1]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n]:[e[0],t,n,e[3]]},t.prototype.call=function(e,t){var n=this;return Object(fU.tidy)(function(){return n.invokeCallHook(e,t),n.poolingFunction(wZ(e),n.poolSize,n.strides,n.padding,n.dataFormat)})},t.prototype.getConfig=function(){var t={poolSize:this.poolSize,padding:this.padding,strides:this.strides,dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(FZ),GK=function(e){function t(t){return e.call(this,t)||this}return kU(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return wY(i),EY(r),VK(e,t,n,r,i,"max")},t.className="MaxPooling2D",t}(ZK);fU.serialization.SerializationMap.register(GK);var KK=function(e){function t(t){return e.call(this,t)||this}return kU(t,e),t.prototype.poolingFunction=function(e,t,n,r,i){return wY(i),EY(r),VK(e,t,n,r,i,"avg")},t.className="AveragePooling2D",t}(ZK);fU.serialization.SerializationMap.register(KK);var qK=function(e){function t(t){var n=e.call(this,t)||this;return n.inputSpec=[new NZ({ndim:3})],n}return kU(t,e),t.prototype.computeOutputShape=function(e){return[e[0],e[2]]},t.prototype.call=function(e,t){throw new KU},t}(FZ),QK=function(e){function t(t){return e.call(this,t)||this}return kU(t,e),t.prototype.call=function(e,t){return Object(fU.tidy)(function(){var t=wZ(e);return Object(fU.mean)(t,1)})},t.className="GlobalAveragePooling1D",t}(qK);fU.serialization.SerializationMap.register(QK);var XK=function(e){function t(t){return e.call(this,t)||this}return kU(t,e),t.prototype.call=function(e,t){return Object(fU.tidy)(function(){var t=wZ(e);return Object(fU.max)(t,1)})},t.className="GlobalMaxPooling1D",t}(qK);fU.serialization.SerializationMap.register(XK);var JK=function(e){function t(t){var n=e.call(this,t)||this;return n.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,wY(n.dataFormat),n.inputSpec=[new NZ({ndim:4})],n}return kU(t,e),t.prototype.computeOutputShape=function(e){return e=e,"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]},t.prototype.call=function(e,t){throw new KU},t.prototype.getConfig=function(){var t={dataFormat:this.dataFormat},n=e.prototype.getConfig.call(this);return Object.assign(t,n),t},t}(FZ),$K=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return kU(t,e),t.prototype.call=function(e,t){var n=this;return Object(fU.tidy)(function(){var t=wZ(e);return"channelsLast"===n.dataFormat?Object(fU.mean)(t,[1,2]):Object(fU.mean)(t,[2,3])})},t.className="GlobalAveragePooling2D",t}(JK);fU.serialization.SerializationMap.register($K);var eq=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return kU(t,e),t.prototype.call=function(e,t){var n=this;return Object(fU.tidy)(function(){var t=wZ(e);return"channelsLast"===n.dataFormat?Object(fU.max)(t,[1,2]):Object(fU.max)(t,[2,3])})},t.className="GlobalMaxPooling2D",t}(JK);function tq(e,t,n,r){if(Array.isArray(e)){if(null!=t||null!=n)throw new GU("When inputs is an array, neither initialState or constants should be provided");null!=r&&(n=e.slice(e.length-r,e.length),e=e.slice(0,e.length-r)),e.length>1&&(t=e.slice(1,e.length)),e=e[0]}function i(e){return null==e||Array.isArray(e)?e:[e]}return{inputs:e,initialState:t=i(t),constants:n=i(n)}}function nq(e,t,n,r,i,o,s,a){void 0===r&&(r=!1),void 0===s&&(s=!1);var u=t.shape.length;if(u<3)throw new GU("Input should be at least 3D, but is "+u+"D.");var l,c,h=[1,0].concat(RY(2,u));if(t=Object(fU.transpose)(t,h),null!=i)throw new KU("The rnn() function of the deeplearn.js backend does not support masking yet.");if(null!=o)throw new KU("The rnn() functoin of the deeplearn.js backend does not support constants yet.");s&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),r&&(t=Object(fU.reverse)(t,0));for(var d=n,p=t.shape[0],f=0;f1?ZY(n,[1,e]):n}):t.cell.stateSize>1?[ZY(n,[1,t.cell.stateSize])]:[n]})},Object.defineProperty(t.prototype,"trainableWeights",{get:function(){return this.trainable?this.cell.trainableWeights:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nonTrainableWeights",{get:function(){return this.trainable?this.cell.nonTrainableWeights:this.cell.weights},enumerable:!0,configurable:!0}),t.prototype.getConfig=function(){var t={returnSequences:this.returnSequences,returnState:this.returnState,goBackwards:this.goBackwards,stateful:this.stateful,unroll:this.unroll};null!=this.numConstants&&(t.numConstants=this.numConstants);var n=this.cell.getConfig();t.cell={className:this.cell.getClassName(),config:n};var r=e.prototype.getConfig.call(this);return Object.assign(t,r),t},t.className="RNN",t}(FZ);fU.serialization.SerializationMap.register(rq);var iq=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return kU(t,e),t}(FZ),oq=function(e){function t(t){var n=e.call(this,t)||this;return n.DEFAULT_ACTIVATION="tanh",n.DEFAULT_KERNEL_INITIALIZER="glorotNormal",n.DEFAULT_RECURRENT_INITIALIZER="orthogonal",n.DEFAULT_BIAS_INITIALIZER="zeros",n.units=t.units,n.activation=eK(null==t.activation?n.DEFAULT_ACTIVATION:t.activation),n.useBias=null==t.useBias||t.useBias,n.kernelInitializer=bZ(t.kernelInitializer||n.DEFAULT_KERNEL_INITIALIZER),n.recurrentInitializer=bZ(t.recurrentInitializer||n.DEFAULT_RECURRENT_INITIALIZER),n.biasInitializer=bZ(t.biasInitializer||n.DEFAULT_BIAS_INITIALIZER),n.kernelRegularizer=cK(t.kernelRegularizer),n.recurrentRegularizer=cK(t.recurrentRegularizer),n.biasRegularizer=cK(t.biasRegularizer),n.kernelConstraint=bY(t.kernelConstraint),n.recurrentConstraint=bY(t.recurrentConstraint),n.biasConstraint=bY(t.biasConstraint),n.dropout=PY([1,BY([0,null==t.dropout?0:t.dropout])]),n.recurrentDropout=PY([1,BY([0,null==t.recurrentDropout?0:t.recurrentDropout])]),n.stateSize=n.units,n.dropoutMask=null,n.recurrentDropoutMask=null,n}return kU(t,e),t.prototype.build=function(e){e=DZ(e),this.kernel=this.addWeight("kernel",[e[e.length-1],this.units],null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint),this.recurrentKernel=this.addWeight("recurrent_kernel",[this.units,this.units],null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias?this.bias=this.addWeight("bias",[this.units],null,this.biasInitializer,this.biasRegularizer,!0,this.biasConstraint):this.bias=null,this.built=!0},t.prototype.call=function(e,t){var n=this;return Object(fU.tidy)(function(){if(2!==(e=e).length)throw new GU("SimpleRNNCell expects 2 input Tensors, got "+e.length+".");var r=e[1];e=e[0];var i,o=null!=t.training&&t.training;01){for(var o=[],s=0;s= 3D, but received input shape "+JSON.stringify(t));this.inputSpec=[{shape:t}];var n=[t[0]].concat(t.slice(2));this.layer.built||(this.layer.build(n),this.layer.built=!0),e.prototype.build.call(this,t)},t.prototype.computeOutputShape=function(e){var t=[(e=DZ(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),r=e[1];return[n[0],r].concat(n.slice(1))},t.prototype.call=function(e,t){var n=this;return Object(fU.tidy)(function(){return nq(function(e,r){return[n.layer.call(e,t),[]]},e=wZ(e),[],!1,null,null,!1,e.shape[1])[1]})},t.className="TimeDistributed",t}(pq);fU.serialization.SerializationMap.register(fq);var gq=["sum","mul","concat","ave"];var mq=function(e){function t(t){var n=e.call(this,t)||this,r=t.layer.getConfig();if(n.forwardLayer=CG({className:t.layer.getClassName(),config:r}),r.goBackwards=!0!==r.goBackwards,n.backwardLayer=CG({className:t.layer.getClassName(),config:r}),n.forwardLayer.name="forward_"+n.forwardLayer.name,n.backwardLayer.name="backward_"+n.backwardLayer.name,function(e){uY(gq,"BidirectionalMergeMode",e)}(t.mergeMode),n.mergeMode=t.mergeMode,t.weights)throw new KU("weights support is not implemented for Bidirectional layer yet.");return n._stateful=t.layer.stateful,n.returnSequences=t.layer.returnSequences,n.returnState=t.layer.returnState,n.supportsMasking=!0,n._trainable=!0,n.inputSpec=t.layer.inputSpec,n.numConstants=null,n}return kU(t,e),Object.defineProperty(t.prototype,"trainable",{get:function(){return this._trainable},set:function(e){this._trainable=e,null!=this.forwardLayer&&(this.forwardLayer.trainable=e),null!=this.backwardLayer&&(this.backwardLayer.trainable=e)},enumerable:!0,configurable:!0}),t.prototype.getWeights=function(){return this.forwardLayer.getWeights().concat(this.backwardLayer.getWeights())},t.prototype.setWeights=function(e){var t=e.length,n=Math.floor(t/2);this.forwardLayer.setWeights(e.slice(0,n)),this.backwardLayer.setWeights(e.slice(n))},t.prototype.computeOutputShape=function(e){var t,n,r,i=this.forwardLayer.computeOutputShape(e);return Array.isArray(i)&&Array.isArray(i[0])||(i=[i]),i=i,this.returnState?(r=i.slice(1),t=i[0]):t=i[0],t=t,"concat"===this.mergeMode?(t[t.length-1]*=2,n=[t]):n=null==this.mergeMode?[t,t.slice()]:[t],this.returnState?null==this.mergeMode?n.concat(r).concat(r.slice()):[t].concat(r).concat(r.slice()):$U(n)},t.prototype.apply=function(t,n){var r=null==n?null:n.initialState,i=null==n?null:n.constants;null==n&&(n={});var o=tq(t,r,i,this.numConstants);if(t=o.inputs,r=o.initialState,i=o.constants,Array.isArray(t)&&(r=t.slice(1),t=t[0]),(null==r||0===r.length)&&null==i)return e.prototype.apply.call(this,t,n);var s=[],a=[];if(null!=r){var u=r.length;if(u%2>0)throw new GU("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");n.initialState=r,s.push.apply(s,r);var l=r.map(function(e){return new NZ({shape:e.shape})});this.forwardLayer.stateSpec=l.slice(0,u/2),this.backwardLayer.stateSpec=l.slice(u/2),a.push.apply(a,l)}if(null!=i)throw new KU("Support for constants in Bidirectional layers is not implemented yet.");for(var c=s[0]instanceof IZ,h=0,d=s;h({a:t,b:n})=>e(t,n);var Nq={"+":({a:e,b:t})=>void 0===e?fU.sum(t):fU.add(e,t),"-":({a:e,b:t})=>void 0===e?fU.neg(t):fU.sub(e,t),"*":({a:e,b:t})=>void 0===e?new Error("TensorFlow.js does not support tf.prod()."):fU.mul(e,t),"×":({a:e,b:t})=>void 0===e?new Error("TensorFlow.js does not support tf.prod()."):fU.mul(e,t),"/":({a:e,b:t})=>void 0===e?fU.reciprocal(t):fU.div(e,t),"÷":({a:e,b:t})=>void 0===e?fU.reciprocal(t):fU.div(e,t),"^":Mq(fU.pow),"%":Mq(fU.mod),"@":Mq(fU.matMul),"⊗":Mq(fU.matMul)},Iq=n(239),Lq=n.n(Iq);const kq=e=>e.dataSync()[0];var Tq={Square:e=>V(fU.square(e)),SquareRoot:e=>V(fU.sqrt(e)),Sign:e=>V(fU.sign(e)),Floor:e=>V(fU.floor(e)),Ceiling:e=>V(fU.ceil(e)),Round:e=>V(fU.round(e)),Absolute:e=>V(fU.abs(e)),Logarithm:e=>V(fU.log(e)),Clip:{[pU.doc]:Lq.a,[pU.call]:e=>{if(void 0===e)return V({[pU.doc]:"\n# Clipper\nClips values to interval `0` – `1`\n```L1\nclipper: Clip !\na: RandomNormal [10 10] -> clipper\n```\n ",[pU.call]:e=>V(fU.maximum(fU.minimum(e,1),0))});if(re(e)){const t=c()({},e),n=t.min,r=t.max;return V({[pU.doc]:`\n# Clipper\nClips values to provided \`min\` and \`max\`\n\`\`\`L1\nclipper: Clip {${n?"\n min: "+kq(n):""}${r?"\n max: "+kq(r):""}\n}\na: RandomNormal [10 10] -> clipper\n\`\`\`\n `,[pU.call]:e=>(r&&r instanceof fU.Tensor&&(e=fU.minimum(e,r)),n&&n instanceof fU.Tensor&&(e=fU.maximum(e,n)),V(e))})}}}},Fq=n(240),Oq=n.n(Fq);const Pq=e=>e.dataSync()[0];var Bq={[Symbol.for("doc")]:Oq.a,[Symbol.for("call")]:e=>{if(void 0===e)return V(fU.linspace(0,1,2));const t=e.hasOwnProperty("start")?Pq(e.start):0,n=e.hasOwnProperty("stop")?Pq(e.stop):1,r=e.hasOwnProperty("count")?Pq(e.count):2;return V(fU.linspace(t,n,r))}},Rq=n(241),jq=n.n(Rq);var zq={[Symbol.for("doc")]:jq.a,[Symbol.for("call")]:e=>V(void 0===e?fU.ones([]):fU.ones((e=>e.dataSync())(e)))},Wq=n(242),Vq=n.n(Wq);var Hq={[Symbol.for("doc")]:Vq.a,[Symbol.for("call")]:e=>V(void 0===e?fU.zeros([]):fU.zeros((e=>e.dataSync())(e)))},Uq=n(243),Yq=n.n(Uq);var Zq={Ones:zq,Zeros:Hq,Eye:{[Symbol.for("doc")]:Yq.a,[Symbol.for("call")]:e=>V(void 0===e?fU.scalar(1):fU.eye((e=>e.dataSync()[0])(e)))},LinearSpace:Bq},Gq=n(244),Kq=n.n(Gq),qq={[pU.call]:e=>V(fU.min(e)),[pU.doc]:Kq.a},Qq=n(245),Xq=n.n(Qq),Jq={[pU.call]:e=>V(fU.max(e)),[pU.doc]:Xq.a},$q=n(246),eQ=n.n($q),tQ={[pU.call]:e=>V(fU.mean(e)),[pU.doc]:eQ.a},nQ=n(247),rQ=n.n(nQ),iQ={[pU.call]:e=>V(fU.sum(e)),[pU.doc]:rQ.a},oQ=n(248),sQ=n.n(oQ),aQ={Min:qq,Max:Jq,Mean:tQ,Sum:iQ,Product:{[pU.call]:e=>fU.prod?V(fU.prod(e)):V(new Error("TensorFlow.js does not support tf.prod().")),[pU.doc]:sQ.a}},uQ=n(249),lQ=n.n(uQ),cQ={[pU.call]:e=>V(fU.tensor(e.shape)),[pU.doc]:lQ.a},hQ=n(250),dQ=n.n(hQ),pQ={[pU.call]:e=>V(fU.tensor(e.size)),[pU.doc]:dQ.a},fQ=n(251),gQ=n.n(fQ),mQ={[pU.call]:e=>V(fU.tensor(e.rank)),[pU.doc]:gQ.a},vQ=n(252),yQ=n.n(vQ),bQ={[pU.call]:e=>{const t=e.dataSync(),n=t.reduce((e,t)=>e*t),r="["+t.join(" ")+"]";return V({[pU.call]:e=>V(fU.reshape(e,t)),[pU.doc]:`# Reshaper\nReshapes tensor to ${r}\n\`\`\`L1\nreshaper: Reshape ${r}\na: RandomNormal ${n} -> reshaper\n\`\`\`\n`})},[pU.doc]:yQ.a},_Q=n(253),CQ=n.n(_Q),wQ={[pU.call]:e=>{const t=e.dataSync()[0];return V({[pU.call]:e=>V(fU.expandDims(e,t)),[pU.doc]:`# Expander\nExpands axis ${t} of provided tensor\n\`\`\`L1\nexpander: Expand ${t}\na: RandomNormal [20 20] -> expander\n\`\`\`\n`})},[pU.doc]:CQ.a},DQ=n(254),EQ=n.n(DQ),AQ={[pU.call]:e=>V(fU.transpose(e)),[pU.doc]:EQ.a},SQ=n(255),xQ=n.n(SQ),MQ={Shape:cQ,Size:pQ,Rank:mQ,Reshape:bQ,Expand:wQ,Transpose:AQ,Reverse:{[pU.call]:e=>V(fU.reverse(e)),[pU.doc]:xQ.a}};window.tf=fU;var NQ=c()({},bU,{Empty:{},False:!1,True:!0,None:void 0},MQ,aQ,Nq,Zq,MU,NU,IU,Tq,{".":({a:e,b:t})=>e[t],Mouse:mU});const IQ=(e,t)=>{if(ue(e))return e(t);if(re(e)){if(e.hasOwnProperty(pU.call))return IQ(e[pU.call],t)}throw new Error(`${e} is not callable`)};var LQ=new class{constructor(){d()(this,"issues",null),d()(this,"rootEnv",NQ),d()(this,"interpret",(e,t={},n)=>{this.issues=n;const r=V(Object.assign(Object.create(this.rootEnv),{Self:this.rootEnv},t));return{success:{result:this.processToken(e,r),state:r}}}),d()(this,"processToken",(e,t)=>{console.log(e),t||console.error("No state to operate on!");const n=this.tokenActions[e.type]||this.tokenActions.__unknown__;let r;try{r=n(e,t)}catch(t){const n={source:e._source||null,message:t.message,severity:t.severity};this.reportIssue(n),console.error(t),r=null}return r}),d()(this,"catchIssue",(e,t,n)=>{const r={source:t._source||null,message:e.message,severity:"error"};return this.reportIssue(r),n||V(e)}),d()(this,"tokenActions",{Program:(e,t)=>{let n=t.pipe(FW(e=>{console.groupCollapsed("State"),console.log("Create new state from:",e)}),BW(e=>Object.assign(Object.create(e),{[pU.meta]:{}})),qW(),FW(e=>{console.log("New state:",e),console.groupEnd()}));return e.value.forEach(e=>{const t=this.processToken(e,n);n=LW(n,t).pipe(FW(([e,t])=>{console.groupCollapsed("State merge"),console.log("Going to merge state and stateDelta",e,t)}),BW(([e,t])=>{const n=Object.keys(t)[0];let r,i=BH(e[pU.meta],t[pU.meta]);return(r=e.hasOwnProperty(n)?BH(e,t):Object.assign(e,t))[pU.meta]=i,r}),FW(e=>{console.log("New merged state",e),console.groupEnd()}),qW())}),n},Assignment:(e,t)=>LW(this.processToken(e.path,t),this.processToken(e.value,t)).pipe(FW(([e,t])=>{console.groupCollapsed("Assignment"),console.log("Creating state delta",e,t)}),QW(t=>this.catchIssue(t,e)),BW(([t,n])=>{const r=[pU.meta,...t],i=sU({},r,{silent:e.silent,source:e._source});return sU(i,t,n),i}),FW(e=>{console.log("New state delta",e),console.groupEnd()})),Path:(e,t)=>V(e.value),FunctionApplication:(e,t)=>LW(this.processToken(e.function,t),this.processToken(e.argument,t)).pipe(FW(([e,t])=>{console.groupCollapsed("Function Application"),console.log("Function",e),console.log("Argument",t)}),function e(t,n){return"function"==typeof n?function(r){return r.pipe(e(function(e,r){return $W(t(e,r)).pipe(BW(function(t,i){return n(e,t,r,i)}))}))}:function(e){return e.lift(new eV(t))}}(([e,t])=>IQ(e,t)),QW(t=>this.catchIssue(t,e)),FW(e=>{console.log("Value",e),console.groupEnd()})),Reference:(e,t)=>LW(this.processToken(e.value,t),t).pipe(FW(([e,t])=>{console.groupCollapsed("Reference"),console.log("Getting a value from reference"),console.log("Path",e),console.log("State",t)}),BW(([e,t])=>{if(!lU(t,e))throw new Error(`No value for ${e.join(".")}`);return hU(t,e)}),QW(t=>this.catchIssue(t,e,V(void 0))),FW(e=>{console.log("Value",e),console.groupEnd()})),Function:(e,t)=>t.pipe(FW(t=>{console.groupCollapsed("Function"),console.log("State",t),console.log("Argument",e.argument)}),BW(t=>n=>{const r=Object.assign(Object.create(t),{[e.argument]:n});return this.processToken(e.value,V(r))}),FW(e=>{console.log("Function",e),console.groupEnd()})),Operation:(e,t)=>{const n=this.processToken(e.left,t),r=this.processToken(e.right,t);return LW(V(this.rootEnv[e.operator]),n,r).pipe(FW(([e,t,n])=>{console.groupCollapsed("Operation"),console.log("Operator",e),console.log("Left argument",t),console.log("Right argument",n)}),BW(([e,t,n])=>IQ(e,{a:t,b:n})),QW(t=>this.catchIssue(t,e)),FW(e=>{console.log("Result from operation:",e),console.groupEnd()}))},Tensor:(e,t)=>{const n=this.processToken(e.value,t);return V(tf.tensor(n))},TensorLiteral:(e,t)=>e.value,Object:(e,t)=>this.processToken(e.value,t),String:(e,t)=>V(e.value),None:(e,t)=>V(void 0),__unknown__:(e,t)=>{throw new Error(`Unrecognized token: ${e.type}, rest: ${e}`)}})}reportIssue({source:e,message:t,severity:n="error"}){const r=c()({},e,{message:t,severity:n});this.issues.next(r)}};var kQ=new class{constructor(){d()(this,"evaluate",async(e,t={},n)=>{const r=(await vW.parse(e,n)).result||void 0,i=r?await LQ.interpret(r,t,n):void 0;return{code:e,ast:r,computedValues:i?i.success.result||[]:{}}})}},TQ=n(16),FQ=n.n(TQ),OQ="[object Boolean]";var PQ=function(e){return!0===e||!1===e||Wz(e)&&ne(e)==OQ},BQ="[object String]";var RQ=function(e){return"string"==typeof e||!Kz(e)&&Wz(e)&&ne(e)==BQ},jQ="[object Number]";var zQ=function(e){return"number"==typeof e||Wz(e)&&ne(e)==jQ};var WQ=function(){return!0},VQ=9007199254740991,HQ=Math.floor;var UQ=function(e,t){var n="";if(!e||t<1||t>VQ)return n;do{t%2&&(n+=e),(t=HQ(t/2))&&(e+=e)}while(t);return n},YQ=NaN,ZQ=/^\s+|\s+$/g,GQ=/^[-+]0x[0-9a-f]+$/i,KQ=/^0b[01]+$/i,qQ=/^0o[0-7]+$/i,QQ=parseInt;var XQ=function(e){if("number"==typeof e)return e;if(jH(e))return YQ;if(re(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=re(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(ZQ,"");var n=KQ.test(e);return n||qQ.test(e)?QQ(e.slice(2),n?2:8):GQ.test(e)?YQ:+e},JQ=1/0,$Q=1.7976931348623157e308;var eX=function(e){return e?(e=XQ(e))===JQ||e===-JQ?(e<0?-1:1)*$Q:e==e?e:0:0===e?e:0};var tX=function(e){var t=eX(e),n=t%1;return t==t?n?t-n:t:0};var nX=function(e,t,n){return t=(n?PH(e,t,n):void 0===t)?1:tX(t),UQ(tU(e),t)},rX=n(257),iX=n.n(rX);n(505);class oX extends a.PureComponent{constructor(...e){super(...e),d()(this,"state",{colorizedValue:null}),d()(this,"_mounted",!1),d()(this,"colorize",async e=>{const t=""+e,n=await Jj.editor.colorize(t,this.props.language);this._mounted&&this.setState({colorizedValue:n})})}componentDidUpdate(){this.colorize(this.props.children)}componentDidMount(){this._mounted=!0,this.colorize(this.props.children)}componentWillUnmount(){this._mounted=!1}render(){return this.state.colorizedValue?u.a.createElement("div",{className:"codeHighlight",dangerouslySetInnerHTML:{__html:this.state.colorizedValue}}):u.a.createElement("div",{className:"codeHighlight"},this.props.children)}}d()(oX,"defaultProps",{language:"L1"});n(506);class sX extends a.PureComponent{constructor(...e){super(...e),d()(this,"state",{numericValue:0}),d()(this,"onKeyDown",e=>{console.log(e);let t=1;if("ArrowUp"===e.key);else{if("ArrowDown"!==e.key)return;t*=-1}e.preventDefault(),e.metaKey&&(t*=100),e.shiftKey&&(t*=10),e.altKey&&(t*=.1);const n=this.state.numericValue+t;this.setState({numericValue:n})})}static getDerivedStateFromProps(e,t){return{numericValue:e.data.dataSync()[0]}}render(){return u.a.createElement("div",{className:"property scalar-input",tabIndex:"0",onKeyDown:this.onKeyDown},u.a.createElement(oX,null,vX(this.state.numericValue)))}}n(507);class aX extends a.PureComponent{constructor(...e){super(...e),d()(this,"onMouseOver",e=>{})}render(){const e=this.props.name||"",t=this.props.symbol||"",n=this.props.type||"";return u.a.createElement("div",{className:`property ${n}`,onMouseOver:this.onMouseOver},u.a.createElement("div",{className:"header"},u.a.createElement("div",{className:"cell name"},u.a.createElement(oX,null,e)),u.a.createElement("div",{className:"cell symbol"},u.a.createElement(oX,null,t))),u.a.createElement("div",{className:"content"},this.props.children))}}var uX=n(24),lX=n.n(uX);n(524);class cX extends a.PureComponent{constructor(...e){super(...e),d()(this,"render",()=>{const e=this.props,t=(e=>{if(2===e.length){const t=lX()(e,2),n=t[0],r=void 0===n?1:n,i=t[1];return[r,void 0===i?1:i]}{const t=lX()(e,1)[0];return[1,void 0===t?1:t]}})(e.data.shape),n=lX()(t,2),r=n[0],i=n[1],o=bX(e.data).dataSync(),s=e.data.dataSync(),a=e.data.size,l=40*i,c=40*r;return u.a.createElement("svg",{className:"svg-tensor",viewBox:`0 0 ${l} ${c}`},u.a.createElement("g",null,Array.from({length:a},(e,t)=>{const n=o[t],r=`rgb(${n}, ${n}, ${n})`,a=n>128?0:255,l=`rgb(${a}, ${a}, ${a})`,c=t%i*40,h=40*Math.floor(t/i);return u.a.createElement("g",{key:t,transform:`translate(${c}, ${h})`},u.a.createElement("rect",{width:40,height:40,fill:r}),u.a.createElement("text",{x:20,y:20,textAnchor:"middle",dominantBaseline:"central",fill:l},vX(s[t],1)))})))})}}n(525);class hX extends a.PureComponent{constructor(...e){super(...e),d()(this,"canvas",null),d()(this,"_mount",e=>{this.canvas=e,this.canvas&&this._draw(this.props.data)}),d()(this,"_draw",async e=>{const t=this.canvas,n=t.getContext("2d"),r=this[`_createImageData${e.rank}D`];if(!ue(r))throw Error("Drawing function is not available.");const i=await r(e,n);t.width=i.width,t.height=i.height,window.requestAnimationFrame(()=>n.putImageData(i,0,0))}),d()(this,"_createImageData0D",async(e,t)=>{return t.createImageData(1,1)}),d()(this,"_createImageData1D",async(e,t)=>{let n=(e=>{const t=lX()(e,2),n=t[0],r=void 0===n?1:n,i=t[1];return[void 0===i?1:i,r]})(e.shape),r=lX()(n,2),i=r[0],o=r[1];const s=t.createImageData(o,i),a=await bX(e),u=await a.data();for(let t=0;t{let n=(e=>{const t=lX()(e,2),n=t[0],r=void 0===n?1:n,i=t[1];return[r,void 0===i?1:i]})(e.shape),r=lX()(n,2),i=r[0],o=r[1];const s=t.createImageData(o,i),a=await bX(e),u=await a.data();for(let t=0;tthis._createImageData2D(e,t))}componentDidUpdate(e,t){this._draw(this.props.data)}render(){return u.a.createElement("div",{className:"canvas"},u.a.createElement("canvas",{className:"tensor-canvas",ref:this._mount}))}}n(526);class dX extends a.PureComponent{constructor(...e){super(...e),d()(this,"state",{data:null,min:0,max:0,mean:0,computing:!1,revisionId:0})}static getDerivedStateFromProps(e,t){if(e.data===t.data&&e.revisionId===t.revisionId)return null;return{data:e.data,revisionId:e.revisionId,computing:!0}}componentDidMount(){this.updateStats(),this._mounted=!0}componentWillUnmount(){this._mounted=!1}componentDidUpdate(e,t){t.data===this.state.data&&t.revisionId===this.state.revisionId||this.updateStats()}async updateStats(){const e={min:(await this.props.data.min().data())[0],max:(await this.props.data.max().data())[0],mean:(await this.props.data.mean().data())[0],computing:!1};this._mounted&&this.setState(e)}render(){return u.a.createElement("div",{className:"info"},u.a.createElement(pX,{name:"Shape"},"["+this.state.data.shape.map(vX).join(" ")+"]"),u.a.createElement(pX,{name:"Size"},vX(this.state.data.size)),u.a.createElement(pX,{name:"Rank"},vX(this.state.data.rank)),u.a.createElement(pX,{name:"Mean"},vX(+this.state.mean)),u.a.createElement(pX,{name:"Range"},vX(this.state.max-this.state.min)),u.a.createElement(pX,{name:"Min"},vX(+this.state.min)),u.a.createElement(pX,{name:"Max"},vX(+this.state.max)))}}const pX=({name:e,children:t})=>u.a.createElement("div",{className:"field"},u.a.createElement("div",{className:"label"},u.a.createElement(oX,null,e)),u.a.createElement("div",{className:"value"},u.a.createElement(oX,null,t)));n(527);class fX extends a.PureComponent{constructor(...e){super(...e),d()(this,"state",{isVariable:!1,data:null,revisionId:0}),d()(this,"update",()=>{this.setState({revisionId:this.state.revisionId+1})})}static getDerivedStateFromProps(e,t){if(e.data!==t.data){const n=e.data instanceof fU.Variable,r=(n?"$":"")+"[]";return{data:e.data,isVariable:n,symbol:r,revisionId:t.revisionId}}return null}componentDidMount(){this.state.isVariable&&this.state.data.subscribe(this.update)}componentDidUpdate(e){e.data!==this.props.data&&(e.data instanceof fU.Variable&&e.data.unsubscribe(this.update),this.state.isVariable&&this.state.data.subscribe(this.update))}componentWillUnmount(){this.state.isVariable&&this.state.data.unsubscribe(this.update)}render(){if(!this.state.data)return null;const e=0===this.state.data.size,t=0===this.state.data.rank,n=e?gX:t?sX:mX;return u.a.createElement(aX,FQ()({},this.props,{type:"tensor "+(t?"scalar":""),symbol:this.state.symbol}),u.a.createElement(n,{data:this.state.data,revisionId:this.state.revisionId}))}}const gX=e=>u.a.createElement("div",null,"Empty tensor");class mX extends a.PureComponent{render(){const e=this.props.data;return u.a.createElement("div",{className:"tensor-content"},u.a.createElement("div",{className:"visualization"},this.props.data.size>25?u.a.createElement(hX,{key:"canvas",data:e,revisionId:this.props.revisionId}):u.a.createElement(cX,{data:e})),u.a.createElement(dX,{key:"stats",data:e,revisionId:this.props.revisionId}))}}const vX=(e,t=2)=>{try{return iX()(e).format(`0,0.[${nX("0",t)}]`).replace(/,/g,"_")}catch(t){return console.log(e,t),"???"}},yX=(e,t,n)=>{const r=e.min(),i=e.max();return t.add(e.sub(r).div(i.sub(r)).mul(n.sub(t)))},bX=e=>{const t=e.sub(e.mean()),n=fU.scalar(-1),r=fU.scalar(1),i=yX(t,n,r);return yX(i,fU.scalar(0),fU.scalar(255))};n(528);var _X=e=>u.a.createElement(aX,FQ()({},e,{type:"function",symbol:"λ => λ"}),u.a.createElement("div",{className:"function-content"},"λ"));n(529);var CX=e=>u.a.createElement(aX,FQ()({},e,{type:"unknown"}));n(530);class wX extends a.PureComponent{constructor(...e){super(...e),d()(this,"state",{data:null,resolved:!1}),d()(this,"_mounted",!1)}resolve(){this.props.data.then(e=>{this._mounted&&this.setState({data:e,resolved:!0})})}componentDidMount(){this._mounted=!0,this.resolve()}componentWillUnmount(){this._mounted=!1}componentDidUpdate(e){e.data!==this.props.data&&(this.setState({resolved:!1}),this.resolve())}render(){return u.a.createElement("div",{className:"promise "+(this.state.resolved?"resolved":"unresolved")},u.a.createElement(BX,FQ()({},this.props,{data:this.state.data})))}}n(531);class DX extends a.PureComponent{constructor(...e){super(...e),d()(this,"state",{data:null,value:void 0,error:void 0,completed:!1}),d()(this,"_mounted",!1),d()(this,"onNext",e=>this.setState({value:e,error:void 0})),d()(this,"onError",e=>this.setState({value:void 0,error:e})),d()(this,"onCompleted",()=>this.setState({completed:!0})),d()(this,"componentDidUpdate",(e,t)=>{t.data!==this.state.data&&(this.subscription.unsubscribe(),this.subscription=this.state.data.subscribe(this.onNext,this.onError,this.onCompleted))}),d()(this,"render",()=>u.a.createElement("div",{className:"observable "+(this.state.error?"error":"")},u.a.createElement(BX,FQ()({},this.props,{data:this.state.error||this.state.value}))))}componentDidMount(){this._mounted=!0,this.subscription=this.props.data.subscribe(this.onNext,this.onError,this.onCompleted)}static getDerivedStateFromProps(e,t){return e.data!==t.data?{data:e.data}:null}componentWillUnmount(){this._mounted=!1,this.subscription.unsubscribe()}}n(532);var EX=e=>u.a.createElement(aX,FQ()({},e,{type:"error",symbol:"🚫"}),u.a.createElement("div",{className:"error-content"},e.data.message));const AX=e=>void 0===e,SX=e=>null===e,xX=e=>"[object Promise]"===e.toString(),MX=e=>e instanceof fU.Tensor,NX=e=>re(e)&&!xX(e),IX=e=>e instanceof Error,LX=e=>e instanceof P,kX=e=>u.a.createElement(aX,FQ()({},e,{type:"string",symbol:'"abc"'}),u.a.createElement("div",null,e.data)),TX=e=>u.a.createElement(aX,FQ()({},e,{type:"number",symbol:"123"}),u.a.createElement("div",null,e.data)),FX=e=>u.a.createElement(aX,FQ()({},e,{type:"boolean",symbol:"0/1"}),u.a.createElement("div",null,e.data?"True":"False")),OX=e=>u.a.createElement(aX,FQ()({},e,{type:"undefined",symbol:"()"})),PX=e=>u.a.createElement(aX,FQ()({},e,{type:"null",symbol:"NULL"}));class BX extends a.PureComponent{constructor(...e){super(...e),d()(this,"visualizations",[[AX,OX],[SX,PX],[PQ,FX],[IX,EX],[RQ,kX],[zQ,TX],[MX,fX],[ue,_X],[LX,DX],[NX,HX],[xX,wX],[WQ,CX]]),d()(this,"valueToVis",e=>this.visualizations.find(([t,n])=>t(e))[1])}render(){const e=this.valueToVis(this.props.data);return u.a.createElement(e,this.props)}}n(533);const RX=e=>{return qj({value:e},{inline:!1,codeBlockRenderer:async function(e="L1",t){const n=await Jj.editor.colorize(t,e);return`\n
    \n \n ${n}\n
    \n `}})};class jX extends a.PureComponent{constructor(...e){super(...e),d()(this,"_containerElement",null),d()(this,"_colorizedElement",null),d()(this,"colorize",async e=>{if(!this._containerElement)return;if(!RQ(e))return;const t=RX(""+e);this._colorizedElement?this._containerElement.replaceChild(t,this._colorizedElement):this._containerElement.appendChild(t),this._colorizedElement=t})}componentDidUpdate(){this.colorize(this.props.children)}componentDidMount(){this._mounted=!0,this.colorize(this.props.children)}componentWillUnmount(){this._mounted=!1}render(){return u.a.createElement("div",{ref:e=>this._containerElement=e,className:"property markdown"})}}n(534);const zX=pU.meta,WX=pU.doc;Object.betterEntries=(e=>{return Object.entries(e).map(([t,n])=>[n,t,e])});const VX=([e,t,n])=>!(n[zX]&&n[zX][t]&&n[zX][t].silent);class HX extends a.PureComponent{render(){const e=this.props.data,t=Object.betterEntries(e).filter(VX).map(([e,t,n])=>{const r=n[zX]&&n[zX][t]?n[zX][t]:null;return u.a.createElement(BX,{key:t,name:t,data:e,_meta:r})}),n=e.hasOwnProperty(pU.doc)?u.a.createElement(jX,null,e[WX]):null;return u.a.createElement(aX,FQ()({type:"object",symbol:"{}"},this.props),u.a.createElement("div",{className:"properties"},n,t))}}class UX extends a.PureComponent{render(){return u.a.createElement(BX,{data:this.props.data,type:"panel"})}}n(535);class YX extends a.PureComponent{constructor(...e){super(...e),d()(this,"state",{scrolled:!1}),d()(this,"onScroll",e=>{e.target.scrollTop>0&&!this.state.scrolled?this.setState({scrolled:!0}):0===e.target.scrollTop&&this.state.scrolled&&this.setState({scrolled:!1})})}render(){const e="panel"+(this.props.scrollable&&this.state.scrolled?" scrolled":"")+(this.props.disabled?" disabled":"");return u.a.createElement("div",{id:this.props.id||"",className:e,onScroll:this.props.scrollable?this.onScroll:void 0},this.props.children)}}var ZX=n(258),GX=n.n(ZX);const KX=e=>H.Base64.encode(e),qX=e=>{try{return H.Base64.decode(e)}catch(e){return}},QX=qX(document.location.hash.substring(1));QX&&history.replaceState({code:QX,saved:!0,timestamp:Date.now()},"","#"+KX(QX));const XX=QX||GX.a;self.MonacoEnvironment={getWorkerUrl:function(e,t){return"json"===t?"./json.worker.js":"./editor.worker.js"}},s.a.render(u.a.createElement(class extends a.PureComponent{constructor(...e){super(...e),d()(this,"_editor",null),d()(this,"state",{code:XX,ast:null,computedValues:V({}),outOfSync:!1}),d()(this,"_onPopState",e=>{e.state&&e.state.code&&this._editor.setContent(e.state.code)}),d()(this,"codeChanged",async(e,t,n,r)=>{r||this.handleHistory(e);const i=await kQ.evaluate(e,{},n);i.ast?this.setState(c()({},i,{outOfSync:!1})):this.setState({code:e,outOfSync:!0})}),d()(this,"saveCode",()=>{history.replaceState({code:this.state.code,saved:!0,timestamp:Date.now()},"","#"+KX(this.state.code))})}componentDidMount(){window.addEventListener("popstate",this._onPopState),window.loadCode=(e=>{const t=qX(e);this._editor.setContent(t),history.pushState({code:t,saved:!0,timestamp:Date.now()},"","#"+e)})}componentWillUnmount(){window.removeEventListener("popstate",this._onPopState)}handleHistory(e){e!==this.state.code&&(history.state?history.state.saved?history.pushState({code:e,saved:!1,timestamp:Date.now()},"","#"):history.replaceState({code:e,saved:!1,timestamp:Date.now()},"","#"):history.pushState({code:e,saved:!1,timestamp:Date.now()},"","#"))}render(){return u.a.createElement("div",{className:"studio"},u.a.createElement(YX,{id:"board",scrollable:!0,disabled:this.state.outOfSync},u.a.createElement(UX,{data:this.state.computedValues})),u.a.createElement(YX,{id:"editor"},u.a.createElement($j,{ref:e=>this._editor=e,content:this.state.code,language:"L1",theme:"L1",onChange:this.codeChanged,onExecute:this.codeChanged.bind(this,this.state.code),onSave:this.saveCode})))}},null),document.querySelector("#studio")),e.hot.accept()}]); ================================================ FILE: latest/b339297726b01d858501.worker.js ================================================ !function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,r){!function(e,t){if(!x[e]||!b[e])return;for(var r in b[e]=!1,t)Object.prototype.hasOwnProperty.call(t,r)&&(d[r]=t[r]);0==--g&&0===v&&T()}(e,r),t&&t(e,r)};var r,n=!0,o="b339297726b01d858501",i=1e4,a={},s=[],c=[];function u(e){var t=E[e];if(!t)return C;var n=function(n){return t.hot.active?(E[n]?-1===E[n].parents.indexOf(e)&&E[n].parents.push(e):(s=[e],r=n),-1===t.children.indexOf(n)&&t.children.push(n)):(console.warn("[HMR] unexpected require("+n+") from disposed module "+e),s=[]),C(n)},o=function(e){return{configurable:!0,enumerable:!0,get:function(){return C[e]},set:function(t){C[e]=t}}};for(var i in C)Object.prototype.hasOwnProperty.call(C,i)&&"e"!==i&&"t"!==i&&Object.defineProperty(n,i,o(i));return n.e=function(e){return"ready"===l&&h("prepare"),v++,C.e(e).then(t,function(e){throw t(),e});function t(){v--,"prepare"===l&&(y[e]||k(e),0===v&&0===g&&T())}},n.t=function(e,t){return 1&t&&(e=n(e)),C.t(e,-2&t)},n}var f=[],l="idle";function h(e){l=e;for(var t=0;t0;){var o=n.pop(),i=o.id,a=o.chain;if((c=E[i])&&!c.hot._selfAccepted){if(c.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:i};if(c.hot._main)return{type:"unaccepted",chain:a,moduleId:i};for(var s=0;s ")),k.type){case"self-declined":t.onDeclined&&t.onDeclined(k),t.ignoreDeclined||(T=new Error("Aborted because of self decline: "+k.moduleId+_));break;case"declined":t.onDeclined&&t.onDeclined(k),t.ignoreDeclined||(T=new Error("Aborted because of declined dependency: "+k.moduleId+" in "+k.parentId+_));break;case"unaccepted":t.onUnaccepted&&t.onUnaccepted(k),t.ignoreUnaccepted||(T=new Error("Aborted because "+u+" is not accepted"+_));break;case"accepted":t.onAccepted&&t.onAccepted(k),A=!0;break;case"disposed":t.onDisposed&&t.onDisposed(k),w=!0;break;default:throw new Error("Unexception type "+k.type)}if(T)return h("abort"),Promise.reject(T);if(A)for(u in y[u]=d[u],p(v,k.outdatedModules),k.outdatedDependencies)Object.prototype.hasOwnProperty.call(k.outdatedDependencies,u)&&(g[u]||(g[u]=[]),p(g[u],k.outdatedDependencies[u]));w&&(p(v,[k.moduleId]),y[u]=b)}var I,P=[];for(n=0;n0;)if(u=M.pop(),c=E[u]){var N={},F=c.hot._disposeHandlers;for(i=0;i=0&&D.parents.splice(I,1))}}for(u in g)if(Object.prototype.hasOwnProperty.call(g,u)&&(c=E[u]))for(V=g[u],i=0;i=0&&c.children.splice(I,1);for(u in h("apply"),o=m,y)Object.prototype.hasOwnProperty.call(y,u)&&(e[u]=y[u]);var W=null;for(u in g)if(Object.prototype.hasOwnProperty.call(g,u)&&(c=E[u])){V=g[u];var R=[];for(n=0;n=0&&t._disposeHandlers.splice(r,1)},check:O,apply:A,status:function(e){if(!e)return l;f.push(e)},addStatusHandler:function(e){f.push(e)},removeStatusHandler:function(e){var t=f.indexOf(e);t>=0&&f.splice(t,1)},data:a[e]};return r=void 0,t}(t),parents:(c=s,s=[],c),children:[]};return e[t].call(n.exports,n,n.exports,u(t)),n.l=!0,n.exports}C.m=e,C.c=E,C.d=function(e,t,r){C.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},C.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},C.t=function(e,t){if(1&t&&(e=C(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(C.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)C.d(r,n,function(t){return e[t]}.bind(null,n));return r},C.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return C.d(t,"a",t),t},C.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},C.p="",C.h=function(){return o},u(3)(C.s=3)}([function(e,t,r){"use strict";(function(e){function r(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}function n(e){return encodeURIComponent(e).replace(/[!'()*]/g,r)}function o(e){return e.replace(/[#?]/,r)}var i,a=function(){function e(){this._scheme=e._empty,this._authority=e._empty,this._path=e._empty,this._query=e._empty,this._fragment=e._empty,this._formatted=null,this._fsPath=null}return e.isUri=function(t){return t instanceof e||!!t&&("string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme)},Object.defineProperty(e.prototype,"scheme",{get:function(){return this._scheme},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"authority",{get:function(){return this._authority},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._path},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fragment",{get:function(){return this._fragment},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fsPath",{get:function(){var t;this._fsPath||(t=this._authority&&this._path&&"file"===this.scheme?"//"+this._authority+this._path:e._driveLetterPath.test(this._path)?this._path[1].toLowerCase()+this._path.substr(2):this._path,i&&(t=t.replace(/\//g,"\\")),this._fsPath=t);return this._fsPath},enumerable:!0,configurable:!0}),e.prototype.with=function(t){if(!t)return this;var r=t.scheme,n=t.authority,o=t.path,i=t.query,a=t.fragment;if(void 0===r?r=this.scheme:null===r&&(r=""),void 0===n?n=this.authority:null===n&&(n=""),void 0===o?o=this.path:null===o&&(o=""),void 0===i?i=this.query:null===i&&(i=""),void 0===a?a=this.fragment:null===a&&(a=""),r===this.scheme&&n===this.authority&&o===this.path&&i===this.query&&a===this.fragment)return this;var s=new e;return s._scheme=r,s._authority=n,s._path=o,s._query=i,s._fragment=a,e._validate(s),s},e.parse=function(t){var r=new e,n=e._parseComponents(t);return r._scheme=n.scheme,r._authority=decodeURIComponent(n.authority),r._path=decodeURIComponent(n.path),r._query=decodeURIComponent(n.query),r._fragment=decodeURIComponent(n.fragment),e._validate(r),r},e.file=function(t){var r=new e;if(r._scheme="file",i&&(t=t.replace(/\\/g,e._slash)),t[0]===e._slash&&t[0]===t[1]){var n=t.indexOf(e._slash,2);-1===n?r._authority=t.substring(2):(r._authority=t.substring(2,n),r._path=t.substring(n))}else r._path=t;return r._path[0]!==e._slash&&(r._path=e._slash+r._path),e._validate(r),r},e._parseComponents=function(t){var r={scheme:e._empty,authority:e._empty,path:e._empty,query:e._empty,fragment:e._empty},n=e._regexp.exec(t);return n&&(r.scheme=n[2]||r.scheme,r.authority=n[4]||r.authority,r.path=n[5]||r.path,r.query=n[7]||r.query,r.fragment=n[9]||r.fragment),r},e.from=function(t){return(new e).with(t)},e._validate=function(t){if(t.scheme&&!e._schemePattern.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path)if(t.authority){if(!e._singleSlashStart.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(e._doubleSlashStart.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')},e.prototype.toString=function(t){return void 0===t&&(t=!1),t?e._asFormatted(this,!0):(this._formatted||(this._formatted=e._asFormatted(this,!1)),this._formatted)},e._asFormatted=function(t,r){var i=r?o:n,a=[],s=t.scheme,c=t.authority,u=t.path,f=t.query,l=t.fragment;(s&&a.push(s,":"),(c||"file"===s)&&a.push("//"),c)&&(-1===(d=(c=c.toLowerCase()).indexOf(":"))?a.push(i(c)):a.push(i(c.substr(0,d)),c.substr(d)));if(u){var h=e._upperCaseDrive.exec(u);h&&(u=h[1]?"/"+h[2].toLowerCase()+u.substr(3):h[2].toLowerCase()+u.substr(2));for(var p=0;;){var d;if(-1===(d=u.indexOf(e._slash,p))){a.push(i(u.substring(p)));break}a.push(i(u.substring(p,d)),e._slash),p=d+1}}return f&&a.push("?",i(f)),l&&a.push("#",i(l)),a.join(e._empty)},e.prototype.toJSON=function(){var e={fsPath:this.fsPath,external:this.toString(),$mid:1};return this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},e.revive=function(t){var r=new e;return r._scheme=t.scheme||e._empty,r._authority=t.authority||e._empty,r._path=t.path||e._empty,r._query=t.query||e._empty,r._fragment=t.fragment||e._empty,r._fsPath=t.fsPath,r._formatted=t.external,e._validate(r),r},e}();if(t.a=a,a._empty="",a._slash="/",a._regexp=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,a._driveLetterPath=/^\/[a-zA-z]:/,a._upperCaseDrive=/^(\/)?([A-Z]:)/,a._schemePattern=/^\w[\w\d+.-]*$/,a._singleSlashStart=/^\//,a._doubleSlashStart=/^\/\//,"object"==typeof e)i="win32"===e.platform;else if("object"==typeof navigator){var s=navigator.userAgent;i=s.indexOf("Windows")>=0}}).call(this,r(2))},function(e,t,r){e.exports=function(){return new Worker(r.p+"51c25ac0adacae5e02ff.worker.js")}},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c,u=[],f=!1,l=-1;function h(){f&&c&&(f=!1,c.length?u=c.concat(u):l=-1,u.length&&p())}function p(){if(!f){var e=s(h);f=!0;for(var t=u.length;t;){for(c=u,u=[];++l1)for(var r=1;r0&&(o.arguments=r),o},e.is=function(e){var t=e;return M.defined(t)&&M.string(t.title)&&M.string(t.title)}}(c||(c={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}}}(u||(u={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return M.defined(t)&&p.is(t.textDocument)&&Array.isArray(t.edits)}}(f||(f={}));var h,p,d,m,g,v,y,b,x,S,O,k,T,A,E,C,w,_,I=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(u.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(u.replace(e,t))},e.prototype.delete=function(e){this.edits.push(u.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}();!function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach(function(e){var r=new I(e.edits);t._textEditChanges[e.textDocument.uri]=r}):e.changes&&Object.keys(e.changes).forEach(function(r){var n=new I(e.changes[r]);t._textEditChanges[r]=n}))}Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(p.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for versioned document changes.");var t=e;if(!(n=this._textEditChanges[t.uri])){var r={textDocument:t,edits:o=[]};this._workspaceEdit.documentChanges.push(r),n=new I(o),this._textEditChanges[t.uri]=n}return n}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var n;if(!(n=this._textEditChanges[e])){var o=[];this._workspaceEdit.changes[e]=o,n=new I(o),this._textEditChanges[e]=n}return n}}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return M.defined(t)&&M.string(t.uri)}}(h||(h={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return M.defined(t)&&M.string(t.uri)&&M.number(t.version)}}(p||(p={})),function(e){e.create=function(e,t,r,n){return{uri:e,languageId:t,version:r,text:n}},e.is=function(e){var t=e;return M.defined(t)&&M.string(t.uri)&&M.string(t.languageId)&&M.number(t.version)&&M.string(t.text)}}(d||(d={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(m||(m={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(g||(g={})),function(e){e.PlainText=1,e.Snippet=2}(v||(v={})),function(e){e.create=function(e){return{label:e}}}(y||(y={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(b||(b={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}(x||(x={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(S||(S={})),function(e){e.create=function(e,t){for(var r=[],n=2;n=0;i--){var a=n[i],s=e.offsetAt(a.range.start),c=e.offsetAt(a.range.end);if(!(c<=o))throw new Error("Ovelapping edit");r=r.substring(0,s)+a.newText+r.substring(c,r.length),o=s}return r}}(j||(j={})),function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3}(V||(V={}));var M,N=function(){function e(e,t,r,n){this._uri=e,this._languageId=t,this._version=r,this._content=n,this._lineOffsets=null}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=null},e.prototype.getLineOffsets=function(){if(null===this._lineOffsets){for(var e=[],t=this._content,r=!0,n=0;n0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),r=0,o=t.length;if(0===o)return n.create(0,e);for(;re?o=i:r=i+1}var a=r-1;return n.create(a,e-t[a])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var r=t[e.line],n=e.line+1=48&&a<=57)i=16*i+a-48;else if(a>=65&&a<=70)i=16*i+a-65+10;else{if(!(a>=97&&a<=102))break;i=16*i+a-97+10}r++,o++}return o=n)return i=n,a=17;var t=e.charCodeAt(r);if(D(t)){do{r++,o+=String.fromCharCode(t),t=e.charCodeAt(r)}while(D(t));return a=15}if(W(t))return r++,o+=String.fromCharCode(t),13===t&&10===e.charCodeAt(r)&&(r++,o+="\n"),a=14;switch(t){case 123:return r++,a=1;case 125:return r++,a=2;case 91:return r++,a=3;case 93:return r++,a=4;case 58:return r++,a=6;case 44:return r++,a=5;case 34:return r++,o=function(){for(var t="",o=r;;){if(r>=n){t+=e.substring(o,r),s=2;break}var i=e.charCodeAt(r);if(34===i){t+=e.substring(o,r),r++;break}if(92!==i){if(i>=0&&i<=31){if(W(i)){t+=e.substring(o,r),s=2;break}s=6}r++}else{if(t+=e.substring(o,r),++r>=n){s=2;break}switch(i=e.charCodeAt(r++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:var a=c(4,!0);a>=0?t+=String.fromCharCode(a):s=4;break;default:s=5}o=r}}return t}(),a=10;case 47:var u=r-1;if(47===e.charCodeAt(r+1)){for(r+=2;r=12&&e<=15);return e}:u,getToken:function(){return a},getTokenValue:function(){return o},getTokenOffset:function(){return i},getTokenLength:function(){return r-i},getTokenError:function(){return s}}}function D(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function W(e){return 10===e||13===e||8232===e||8233===e}function R(e){return e>=48&&e<=57}function $(e,t,r){var n,o,i,a,s;if(t){for(a=t.offset,s=a+t.length,i=a;i>0&&!L(e,i-1);)i--;for(var c=s;ca&&e.substring(r,n)!==t&&v.push({offset:r,length:n-r,content:t})}var b=g();if(17!==b){var x=p.getTokenOffset()+i;y(U(u,n),i,x)}for(;17!==b;){for(var S=p.getTokenOffset()+p.getTokenLength()+i,O=g(),k="";!l&&(12===O||13===O);){y(" ",S,p.getTokenOffset()+i),S=p.getTokenOffset()+p.getTokenLength()+i,k=12===O?m():"",O=g()}if(2===O)1!==b&&(h--,k=m());else if(4===O)3!==b&&(h--,k=m());else{switch(b){case 3:case 1:h++,k=m();break;case 5:case 12:k=m();break;case 13:k=l?m():" ";break;case 6:k=" ";break;case 10:if(6===O){k="";break}case 7:case 8:case 9:case 11:case 2:case 4:12===O||13===O?k=" ":5!==O&&17!==O&&(d=!0);break;case 16:d=!0}!l||12!==O&&13!==O||(k=m())}y(k,S,p.getTokenOffset()+i),b=O}return v}function U(e,t){for(var r="",n=0;n0)for(var o=n.getToken();17!==o;){if(-1!==t.indexOf(o)){v();break}if(-1!==r.indexOf(o))break;o=v()}}function b(e){var t=n.getTokenValue();return e?l(t):s(t),v(),!0}function x(){switch(n.getToken()){case 3:return function(){u(),v();for(var e=!1;4!==n.getToken()&&17!==n.getToken();){if(5===n.getToken()){if(e||y(4,[],[]),h(","),v(),4===n.getToken()&&g)break}else e&&y(6,[],[]);x()||y(4,[],[4,5]),e=!0}return f(),4!==n.getToken()?y(8,[4],[]):v(),!0}();case 1:return function(){a(),v();for(var e=!1;2!==n.getToken()&&17!==n.getToken();){if(5===n.getToken()){if(e||y(4,[],[]),h(","),v(),2===n.getToken()&&g)break}else e&&y(6,[],[]);(10!==n.getToken()?(y(3,[],[2,5]),0):(b(!1),6===n.getToken()?(h(":"),v(),x()||y(4,[],[2,5])):y(5,[],[2,5]),1))||y(4,[],[2,5]),e=!0}return c(),2!==n.getToken()?y(7,[2],[]):v(),!0}();case 10:return b(!0);default:return function(){switch(n.getToken()){case 11:var e=0;try{"number"!=typeof(e=JSON.parse(n.getTokenValue()))&&(y(2),e=0)}catch(e){y(2)}l(e);break;case 7:l(null);break;case 8:l(!0);break;case 9:l(!1);break;default:return!1}return v(),!0}()}}return v(),17===n.getToken()||(x()?(17!==n.getToken()&&y(9,[],[]),!0):(y(4,[],[]),!1))}!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.func=function(e){return"[object Function]"===t.call(e)},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(M||(M={}));var H=F,B=function(e,t,r){void 0===t&&(t=[]);var n=null,o=[],i=[];function a(e){Array.isArray(o)?o.push(e):n&&(o[n]=e)}return q(e,{onObjectBegin:function(){var e={};a(e),i.push(o),o=e,n=null},onObjectProperty:function(e){n=e},onObjectEnd:function(){o=i.pop()},onArrayBegin:function(){var e=[];a(e),i.push(o),o=e,n=null},onArrayEnd:function(){o=i.pop()},onLiteralValue:a,onError:function(e,r,n){t.push({error:e,offset:r,length:n})}},r),o[0]};function J(e,t){if(e===t)return!0;if(null===e||void 0===e||null===t||void 0===t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;var r,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(r=0;r()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;!function(e){e.Ignore="ignore",e.Error="error",e.Warning="warning"}(ee||(ee={}));var ne,oe=function(){function e(e,t,r){this.offset=t,this.length=r,this.parent=e}return Object.defineProperty(e.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},e}(),ie=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="null",n}return Q(t,e),t}(oe),ae=function(e){function t(t,r,n){var o=e.call(this,t,n)||this;return o.type="boolean",o.value=r,o}return Q(t,e),t}(oe),se=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="array",n.items=[],n}return Q(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),t}(oe),ce=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="number",n.isInteger=!0,n.value=Number.NaN,n}return Q(t,e),t}(oe),ue=function(e){function t(t,r,n){var o=e.call(this,t,r,n)||this;return o.type="string",o.value="",o}return Q(t,e),t}(oe),fe=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="property",n.colonOffset=-1,n}return Q(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),t}(oe),le=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="object",n.properties=[],n}return Q(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),t}(oe);function he(e){return"boolean"==typeof e?e?{}:{not:{}}:e}!function(e){e[e.Key=0]="Key",e[e.Enum=1]="Enum"}(ne||(ne={}));var pe=function(){function e(e,t){void 0===e&&(e=-1),void 0===t&&(t=null),this.focusOffset=e,this.exclude=t,this.schemas=[]}return e.prototype.add=function(e){this.schemas.push(e)},e.prototype.merge=function(e){var t;(t=this.schemas).push.apply(t,e.schemas)},e.prototype.include=function(e){return(-1===this.focusOffset||ye(e,this.focusOffset))&&e!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e}(),de=function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.add=function(e){},e.prototype.merge=function(e){},e.prototype.include=function(e){return!0},e.prototype.newSub=function(){return this},e.instance=new e,e}(),me=function(){function e(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return e.prototype.hasProblems=function(){return!!this.problems.length},e.prototype.mergeAll=function(e){var t=this;e.forEach(function(e){t.merge(e)})},e.prototype.merge=function(e){this.problems=this.problems.concat(e.problems)},e.prototype.mergeEnumValues=function(e){if(!this.enumValueMatch&&!e.enumValueMatch&&this.enumValues&&e.enumValues){this.enumValues=this.enumValues.concat(e.enumValues);for(var t=0,r=this.problems;t=e.offset&&t=r.offset&&e=r.offset&&e<=r.offset+r.length){for(var n=r.children,o=0;o=0;)i.splice(t,1),t=i.indexOf(e)};t.properties&&Object.keys(t.properties).forEach(function(e){a(e);var i=t.properties[e],s=o[e];if(s)if("boolean"==typeof i)if(i)r.propertiesMatches++,r.propertiesValueMatches++;else{var c=s.parent;r.problems.push({location:{offset:c.keyNode.offset,length:c.keyNode.length},severity:ee.Warning,message:t.errorMessage||Y("DisallowedExtraPropWarning","Property {0} is not allowed.",e)})}else{var u=new me;xe(s,i,u,n),r.mergePropertyMatch(u)}});t.patternProperties&&Object.keys(t.patternProperties).forEach(function(e){var s=new RegExp(e);i.slice(0).forEach(function(i){if(s.test(i)){a(i);var c=o[i];if(c){var u=t.patternProperties[e];if("boolean"==typeof u)if(u)r.propertiesMatches++,r.propertiesValueMatches++;else{var f=c.parent;r.problems.push({location:{offset:f.keyNode.offset,length:f.keyNode.length},severity:ee.Warning,message:t.errorMessage||Y("DisallowedExtraPropWarning","Property {0} is not allowed.",i)})}else{var l=new me;xe(c,u,l,n),r.mergePropertyMatch(l)}}}})});"object"==typeof t.additionalProperties?i.forEach(function(e){var i=o[e];if(i){var a=new me;xe(i,t.additionalProperties,a,n),r.mergePropertyMatch(a)}}):!1===t.additionalProperties&&i.length>0&&i.forEach(function(e){var n=o[e];if(n){var i=n.parent;r.problems.push({location:{offset:i.keyNode.offset,length:i.keyNode.length},severity:ee.Warning,message:t.errorMessage||Y("DisallowedExtraPropWarning","Property {0} is not allowed.",e)})}});t.maxProperties&&e.properties.length>t.maxProperties&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:Y("MaxPropWarning","Object has more properties than limit of {0}.",t.maxProperties)});t.minProperties&&e.properties.length=o.length&&r.propertiesValueMatches++}),e.items.length>o.length)if("object"==typeof t.additionalItems)for(var i=o.length;it.maxItems&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:Y("maxItemsWarning","Array has too many items. Expected {0} or fewer.",t.minItems)});if(!0===t.uniqueItems){var f=ge(e),l=f.some(function(e,t){return t!==f.lastIndexOf(e)});l&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:Y("uniqueItemsWarning","Array has duplicate items.")})}}(e,t,r,n);break;case"string":!function(e,t,r,n){t.minLength&&e.value.lengtht.maxLength&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:Y("maxLengthWarning","String is longer than the maximum length of {0}.",t.maxLength)});if(t.pattern){var o=new RegExp(t.pattern);o.test(e.value)||r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:t.patternErrorMessage||t.errorMessage||Y("patternWarning",'String does not match the pattern of "{0}".',t.pattern)})}if(t.format)switch(t.format){case"uri":case"uri-reference":var i=void 0;if(e.value)try{var a=X.a.parse(e.value);a.scheme||"uri"!==t.format||(i=Y("uriSchemeMissing","URI with a scheme is expected."))}catch(e){i=e.message}else i=Y("uriEmpty","URI expected.");i&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:t.patternErrorMessage||t.errorMessage||Y("uriFormatWarning","String is not a URI: {0}",i)});break;case"email":e.value.match(re)||r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:t.patternErrorMessage||t.errorMessage||Y("emailFormatWarning","String is not an e-mail address.")});break;case"color-hex":e.value.match(te)||r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:t.patternErrorMessage||t.errorMessage||Y("colorHexFormatWarning","Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.")})}}(e,t,r);break;case"number":!function(e,t,r,n){var o=e.value;"number"==typeof t.multipleOf&&o%t.multipleOf!=0&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:Y("multipleOfWarning","Value is not divisible by {0}.",t.multipleOf)});function i(e,t){return"number"==typeof t?t:"boolean"==typeof t&&t?e:void 0}function a(e,t){if("boolean"!=typeof t||!t)return e}var s=i(t.minimum,t.exclusiveMinimum);"number"==typeof s&&o<=s&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:Y("exclusiveMinimumWarning","Value is below the exclusive minimum of {0}.",s)});var c=i(t.maximum,t.exclusiveMaximum);"number"==typeof c&&o>=c&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:Y("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",c)});var u=a(t.minimum,t.exclusiveMinimum);"number"==typeof u&&of&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:Y("maximumWarning","Value is above the maximum of {0}.",f)})}(e,t,r);break;case"property":return xe(e.valueNode,t,r,n)}!function(){function o(t){return e.type===t||"integer"===t&&"number"===e.type&&e.isInteger}Array.isArray(t.type)?t.type.some(o)||r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:t.errorMessage||Y("typeArrayMismatchWarning","Incorrect type. Expected one of {0}.",t.type.join(", "))}):t.type&&(o(t.type)||r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:t.errorMessage||Y("typeMismatchWarning",'Incorrect type. Expected "{0}".',t.type)}));Array.isArray(t.allOf)&&t.allOf.forEach(function(t){xe(e,he(t),r,n)});var i=he(t.not);if(i){var a=new me,s=n.newSub();xe(e,i,a,s),a.hasProblems()||r.problems.push({location:{offset:e.offset,length:e.length},severity:ee.Warning,message:Y("notSchemaWarning","Matches a schema that is not allowed.")}),s.schemas.forEach(function(e){e.inverted=!e.inverted,n.add(e)})}var c=function(t,o){var i=[],a=null;return t.forEach(function(t){var r=he(t),s=new me,c=n.newSub();if(xe(e,r,s,c),s.hasProblems()||i.push(r),a)if(o||s.hasProblems()||a.validationResult.hasProblems()){var u=s.compare(a.validationResult);u>0?a={schema:r,validationResult:s,matchingSchemas:c}:0===u&&(a.matchingSchemas.merge(c),a.validationResult.mergeEnumValues(s))}else a.matchingSchemas.merge(c),a.validationResult.propertiesMatches+=s.propertiesMatches,a.validationResult.propertiesValueMatches+=s.propertiesValueMatches;else a={schema:r,validationResult:s,matchingSchemas:c}}),i.length>1&&o&&r.problems.push({location:{offset:e.offset,length:1},severity:ee.Warning,message:Y("oneOfWarning","Matches multiple schemas when only one must validate.")}),null!==a&&(r.merge(a.validationResult),r.propertiesMatches+=a.validationResult.propertiesMatches,r.propertiesValueMatches+=a.validationResult.propertiesValueMatches,n.merge(a.matchingSchemas)),i.length};Array.isArray(t.anyOf)&&c(t.anyOf,!1);Array.isArray(t.oneOf)&&c(t.oneOf,!0);if(Array.isArray(t.enum)){for(var u=ge(e),f=!1,l=0,h=t.enum;l0){for(u--;u>0&&/\s/.test(n.charAt(u));)u--;l=u+1}if(s(e,t,{offset:u,length:l-u}),r&&f(r,!1),i.length+c.length>0)for(var h=o.getToken();17!==h;){if(-1!==i.indexOf(h)){a();break}if(-1!==c.indexOf(h))break;h=a()}return r}function u(){switch(o.getTokenError()){case 4:return c(Y("InvalidUnicode","Invalid unicode sequence in string."),Z.InvalidUnicode),!0;case 5:return c(Y("InvalidEscapeCharacter","Invalid escape character in string."),Z.InvalidEscapeCharacter),!0;case 3:return c(Y("UnexpectedEndOfNumber","Unexpected end of number."),Z.UnexpectedEndOfNumber),!0;case 1:return c(Y("UnexpectedEndOfComment","Unexpected end of comment."),Z.UnexpectedEndOfComment),!0;case 2:return c(Y("UnexpectedEndOfString","Unexpected end of string."),Z.UnexpectedEndOfString),!0;case 6:return c(Y("InvalidCharacter","Invalid characters in string. Control characters must be escaped."),Z.InvalidCharacter),!0}return!1}function f(e,t){return e.length=o.getTokenOffset()+o.getTokenLength()-e.offset,t&&a(),e}function l(t,n){var i=new fe(t,o.getTokenOffset()),s=h(i);if(!s){if(16!==o.getToken())return null;c(Y("DoubleQuotesExpected","Property keys must be doublequoted"),Z.Undefined);var u=new ue(i,o.getTokenOffset(),o.getTokenLength());u.value=o.getTokenValue(),s=u,a()}i.keyNode=s;var f=n[s.value];if(f?(r.push({location:{offset:i.keyNode.offset,length:i.keyNode.length},message:Y("DuplicateKeyWarning","Duplicate object key"),code:Z.Undefined,severity:ee.Warning}),"object"==typeof f&&r.push({location:{offset:f.keyNode.offset,length:f.keyNode.length},message:Y("DuplicateKeyWarning","Duplicate object key"),code:Z.Undefined,severity:ee.Warning}),n[s.value]=!0):n[s.value]=i,6===o.getToken())i.colonOffset=o.getTokenOffset(),a();else if(c(Y("ColonExpected","Colon expected"),Z.ColonExpected),10===o.getToken()&&e.positionAt(s.offset+s.length).line0?e.lastIndexOf(t)===r:0===r&&e===t}var ke=K(),Te=function(){function e(e,t,r){void 0===t&&(t=[]),this.templateVarIdCounter=0,this.schemaService=e,this.contributions=t,this.promise=r||Promise}return e.prototype.doResolve=function(e){for(var t=this.contributions.length-1;t>=0;t--)if(this.contributions[t].resolveCompletion){var r=this.contributions[t].resolveCompletion(e);if(r)return r}return this.promise.resolve(e)},e.prototype.doComplete=function(e,t,r){var n=this,i={items:[],isIncomplete:!1},a=e.offsetAt(t),s=r.getNodeFromOffsetEndInclusive(a);if(this.isInComment(e,s?s.offset:0,a))return Promise.resolve(i);var c=this.getCurrentWord(e,a),f=null;if(!s||"string"!==s.type&&"number"!==s.type&&"boolean"!==s.type&&"null"!==s.type){var l=a-c.length;l>0&&'"'===e.getText()[l-1]&&l--,f=o.create(e.positionAt(l),t)}else f=o.create(e.positionAt(s.offset),e.positionAt(s.offset+s.length));var h={},p={add:function(e){var t=h[e.label];t?t.documentation||(t.documentation=e.documentation):(h[e.label]=e,f&&(e.textEdit=u.replace(f,e.insertText)),i.items.push(e))},setAsIncomplete:function(){i.isIncomplete=!0},error:function(e){console.error(e)},log:function(e){console.log(e)},getNumberOfProposals:function(){return i.items.length}};return this.schemaService.getSchemaForResource(e.uri,r).then(function(t){var o=[],u=!0,l="",d=null;if(s&&"string"===s.type){var m=s.parent;m&&"property"===m.type&&m.keyNode===s&&(u=!m.valueNode,d=m,l=e.getText().substr(s.offset+1,s.length-2),m&&(s=m.parent))}if(s&&"object"===s.type){if(s.offset===a)return i;s.properties.forEach(function(e){d&&d===e||(h[e.keyNode.value]=y.create("__"))});var b="";u&&(b=n.evaluateSeparatorAfter(e,e.offsetAt(f.end))),t?n.getPropertyCompletions(t,r,s,u,b,p):n.getSchemaLessPropertyCompletions(r,s,l,p);var x=ve(s);n.contributions.forEach(function(t){var r=t.collectPropertyCompletions(e.uri,x,c,u,""===b,p);r&&o.push(r)}),!t&&c.length>0&&'"'!==e.getText().charAt(a-c.length-1)&&p.add({kind:g.Property,label:n.getLabelForValue(c),insertText:n.getInsertTextForProperty(c,null,!1,b),insertTextFormat:v.Snippet,documentation:""})}var S={};return t?n.getValueCompletions(t,r,s,a,e,p,S):n.getSchemaLessValueCompletions(r,s,a,e,p),n.contributions.length>0&&n.getContributedValueCompletions(r,s,a,e,p,o),n.promise.all(o).then(function(){if(0===p.getNumberOfProposals()){var t=a;!s||"string"!==s.type&&"number"!==s.type&&"boolean"!==s.type&&"null"!==s.type||(t=s.offset+s.length);var r=n.evaluateSeparatorAfter(e,t);n.addFillerValueCompletions(S,r,p)}return i})})},e.prototype.getPropertyCompletions=function(e,t,r,n,o,i){var a=this;t.getMatchingSchemas(e.schema,r.offset).forEach(function(e){if(e.node===r&&!e.inverted){var t=e.schema.properties;t&&Object.keys(t).forEach(function(e){var r=t[e];if("object"==typeof r&&!r.deprecationMessage&&!r.doNotSuggest){var s={kind:g.Property,label:e,insertText:a.getInsertTextForProperty(e,r,n,o),insertTextFormat:v.Snippet,filterText:a.getFilterTextForValue(e),documentation:r.description||""};Oe(s.insertText,"$1"+o)&&(s.command={title:"Suggest",command:"editor.action.triggerSuggest"}),i.add(s)}})}})},e.prototype.getSchemaLessPropertyCompletions=function(e,t,r,n){var o=this,i=function(e){e.properties.forEach(function(e){var t=e.keyNode.value;n.add({kind:g.Property,label:t,insertText:o.getInsertTextForValue(t,""),insertTextFormat:v.Snippet,filterText:o.getFilterTextForValue(t),documentation:""})})};if(t.parent)if("property"===t.parent.type){var a=t.parent.keyNode.value;e.visit(function(e){return"property"===e.type&&e!==t.parent&&e.keyNode.value===a&&e.valueNode&&"object"===e.valueNode.type&&i(e.valueNode),!0})}else"array"===t.parent.type&&t.parent.items.forEach(function(e){"object"===e.type&&e!==t&&i(e)});else"object"===t.type&&n.add({kind:g.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:v.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},e.prototype.getSchemaLessValueCompletions=function(e,t,r,n,o){var i=this,a=r;if(!t||"string"!==t.type&&"number"!==t.type&&"boolean"!==t.type&&"null"!==t.type||(a=t.offset+t.length,t=t.parent),!t)return o.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:v.Snippet,documentation:""}),void o.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:v.Snippet,documentation:""});var s=this.evaluateSeparatorAfter(n,a),c=function(e){ye(e.parent,r,!0)||o.add({kind:i.getSuggestionKind(e.type),label:i.getLabelTextForMatchingNode(e,n),insertText:i.getInsertTextForMatchingNode(e,n,s),insertTextFormat:v.Snippet,documentation:""}),"boolean"===e.type&&i.addBooleanValueCompletion(!e.value,s,o)};if("property"===t.type&&r>t.colonOffset){var u=t.valueNode;if(u&&(r>u.offset+u.length||"object"===u.type||"array"===u.type))return;var f=t.keyNode.value;e.visit(function(e){return"property"===e.type&&e.keyNode.value===f&&e.valueNode&&c(e.valueNode),!0}),"$schema"===f&&t.parent&&!t.parent.parent&&this.addDollarSchemaCompletions(s,o)}if("array"===t.type)if(t.parent&&"property"===t.parent.type){var l=t.parent.keyNode.value;e.visit(function(e){var t=e;return"property"===e.type&&t.keyNode.value===l&&t.valueNode&&"array"===t.valueNode.type&&t.valueNode.items.forEach(c),!0})}else t.items.forEach(c)},e.prototype.getValueCompletions=function(e,t,r,n,o,i,a){var s=this,c=n,u=null,f=null;if(!r||"string"!==r.type&&"number"!==r.type&&"boolean"!==r.type&&"null"!==r.type||(c=r.offset+r.length,f=r,r=r.parent),r){if("property"===r.type&&n>r.colonOffset){var l=r.valueNode;if(l&&n>l.offset+l.length)return;u=r.keyNode.value,r=r.parent}if(r&&(null!==u||"array"===r.type)){var h=this.evaluateSeparatorAfter(o,c);t.getMatchingSchemas(e.schema,r.offset,f).forEach(function(e){if(e.node===r&&!e.inverted&&e.schema){if("array"===r.type&&e.schema.items)if(Array.isArray(e.schema.items)){var t=s.findItemAtOffset(r,o,n);tt.colonOffset){var a=t.keyNode.value,s=t.valueNode;if(!s||r<=s.offset+s.length){var c=ve(t.parent);this.contributions.forEach(function(e){var t=e.collectValueCompletions(n.uri,c,a,o);t&&i.push(t)})}}}else this.contributions.forEach(function(e){var t=e.collectDefaultCompletions(n.uri,o);t&&i.push(t)})},e.prototype.addSchemaValueCompletions=function(e,t,r,n){var o=this;"object"==typeof e&&(this.addEnumValueCompletions(e,t,r),this.addDefaultValueCompletions(e,t,r),this.collectTypes(e,n),Array.isArray(e.allOf)&&e.allOf.forEach(function(e){return o.addSchemaValueCompletions(e,t,r,n)}),Array.isArray(e.anyOf)&&e.anyOf.forEach(function(e){return o.addSchemaValueCompletions(e,t,r,n)}),Array.isArray(e.oneOf)&&e.oneOf.forEach(function(e){return o.addSchemaValueCompletions(e,t,r,n)}))},e.prototype.addDefaultValueCompletions=function(e,t,r,n){var o=this;void 0===n&&(n=0);var i=!1;if(e.default){for(var a=e.type,s=e.default,c=n;c>0;c--)s=[s],a="array";r.add({kind:this.getSuggestionKind(a),label:this.getLabelForValue(s),insertText:this.getInsertTextForValue(s,t),insertTextFormat:v.Snippet,detail:ke("json.suggest.default","Default value")}),i=!0}Array.isArray(e.defaultSnippets)&&e.defaultSnippets.forEach(function(a){var s,c,u=e.type,f=a.body,l=a.label;if(void 0!==f){e.type;for(var h=n;h>0;h--)f=[f],"array";s=o.getInsertTextForSnippetValue(f,t),c=o.getFilterTextForSnippetValue(f),l=l||o.getLabelForSnippetValue(f)}else if("string"==typeof a.bodyText){var p="",d="",m="";for(h=n;h>0;h--)p=p+m+"[\n",d=d+"\n"+m+"]",m+="\t",u="array";s=p+m+a.bodyText.split("\n").join("\n"+m)+d+t,l=l||s,c=s.replace(/[\n]/g,"")}r.add({kind:o.getSuggestionKind(u),label:l,documentation:a.description,insertText:s,insertTextFormat:v.Snippet,filterText:c}),i=!0}),i||"object"!=typeof e.items||Array.isArray(e.items)||this.addDefaultValueCompletions(e.items,t,r,n+1)},e.prototype.addEnumValueCompletions=function(e,t,r){if(Array.isArray(e.enum))for(var n=0,o=e.enum.length;n57?t.substr(0,57).trim()+"...":t},e.prototype.getFilterTextForValue=function(e){return JSON.stringify(e)},e.prototype.getFilterTextForSnippetValue=function(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getLabelForSnippetValue=function(e){var t=JSON.stringify(e);return(t=t.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")).length>57?t.substr(0,57).trim()+"...":t},e.prototype.getInsertTextForPlainText=function(e){return e.replace(/[\\\$\}]/g,"\\$&")},e.prototype.getInsertTextForValue=function(e,t){var r=JSON.stringify(e,null,"\t");return"{}"===r?"{\n\t$1\n}"+t:"[]"===r?"[\n\t$1\n]"+t:this.getInsertTextForPlainText(r+t)},e.prototype.getInsertTextForSnippetValue=function(e,t){return function e(t,r,n){if(null!==t&&"object"==typeof t){var o=r+"\t";if(Array.isArray(t)){if(0===t.length)return"[]";for(var i="[\n",a=0;a0?t[0]:null}if(!e)return g.Value;switch(e){case"string":return g.Value;case"object":return g.Module;case"property":return g.Property;default:return g.Value}},e.prototype.getLabelTextForMatchingNode=function(e,t){switch(e.type){case"array":return"[]";case"object":return"{}";default:return t.getText().substr(e.offset,e.length)}},e.prototype.getInsertTextForMatchingNode=function(e,t,r){switch(e.type){case"array":return this.getInsertTextForValue([],r);case"object":return this.getInsertTextForValue({},r);default:var n=t.getText().substr(e.offset,e.length)+r;return this.getInsertTextForPlainText(n)}},e.prototype.getInsertTextForProperty=function(e,t,r,n){var o=this.getInsertTextForValue(e,"");if(!r)return o;var i,a=o+": ",s=0;if(t){if(Array.isArray(t.defaultSnippets)){if(1===t.defaultSnippets.length){var c=t.defaultSnippets[0].body;void 0!==c&&(i=this.getInsertTextForSnippetValue(c,""))}s+=t.defaultSnippets.length}if(t.enum&&(i||1!==t.enum.length||(i=this.getInsertTextForGuessedValue(t.enum[0],"")),s+=t.enum.length),void 0!==t.default&&(i||(i=this.getInsertTextForGuessedValue(t.default,"")),s++),0===s){var u=Array.isArray(t.type)?t.type[0]:t.type;switch(u||(t.properties?u="object":t.items&&(u="array")),u){case"boolean":i="$1";break;case"string":i='"$1"';break;case"object":i="{\n\t$1\n}";break;case"array":i="[\n\t$1\n]";break;case"number":case"integer":i="${1:0}";break;case"null":i="${1:null}";break;default:return o}}}return(!i||s>1)&&(i="$1"),a+i+n},e.prototype.getCurrentWord=function(e,t){for(var r=t-1,n=e.getText();r>=0&&-1===' \t\n\r\v":{[,]}'.indexOf(n.charAt(r));)r--;return n.substring(r+1,t)},e.prototype.evaluateSeparatorAfter=function(e,t){var r=H(e.getText(),!0);switch(r.setPosition(t),r.scan()){case 5:case 2:case 4:case 17:return"";default:return","}},e.prototype.findItemAtOffset=function(e,t,r){for(var n=H(t.getText(),!0),o=e.items,i=o.length-1;i>=0;i--){var a=o[i];if(r>a.offset+a.length)return n.setPosition(a.offset+a.length),5===n.scan()&&r>=n.getTokenOffset()+n.getTokenLength()?i+1:i;if(r>=a.offset)return i}return 0},e.prototype.isInComment=function(e,t,r){var n=H(e.getText(),!1);n.setPosition(t);for(var o=n.scan();17!==o&&n.getTokenOffset()+n.getTokenLength()i.offset+1&&n=0;l--){var h=this.contributions[l].getInfoContribution(e.uri,f);if(h)return h.then(function(e){return u(e)})}return this.schemaService.getSchemaForResource(e.uri,r).then(function(e){if(e){var t=null,n=null,o=null,a=null;r.getMatchingSchemas(e.schema,i.offset).every(function(e){if(e.node===i&&!e.inverted&&e.schema&&(t=t||e.schema.title,n=n||e.schema.markdownDescription||Ee(e.schema.description),e.schema.enum)){var r=e.schema.enum.indexOf(ge(i));e.schema.markdownEnumDescriptions?o=e.schema.markdownEnumDescriptions[r]:e.schema.enumDescriptions&&(o=Ee(e.schema.enumDescriptions[r])),o&&"string"!=typeof(a=e.schema.enum[r])&&(a=JSON.stringify(a))}return!0});var s="";return t&&(s=Ee(t)),n&&(s.length>0&&(s+="\n\n"),s+=n),o&&(s.length>0&&(s+="\n\n"),s+="`"+Ee(a)+"`: "+o),u([s])}return null})},e}();function Ee(e){if(e)return e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,"$1\n\n$3").replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}var Ce=K(),we=function(){function e(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}return e.prototype.configure=function(e){e&&(this.validationEnabled=e.validate,this.commentSeverity=e.allowComments?ee.Ignore:ee.Error)},e.prototype.doValidation=function(e,t,r){var n=this;if(!this.validationEnabled)return this.promise.resolve([]);var o=[],i={},s=function(t){if(t.severity!==ee.Ignore){var r=t.location.offset+" "+t.location.length+" "+t.message;if(!i[r]){i[r]=!0;var n={start:e.positionAt(t.location.offset),end:e.positionAt(t.location.offset+t.location.length)},s=t.severity===ee.Error?a.Error:a.Warning;o.push({severity:s,range:n,message:t.message})}}};return this.jsonSchemaService.getSchemaForResource(e.uri,t).then(function(e){var i=r?r.trailingCommas:ee.Error,a=r?r.comments:n.commentSeverity;if(e){if(e.errors.length&&t.root){var c=t.root,u="object"===c.type?c.properties[0]:null;if(u&&"$schema"===u.keyNode.value){var f=u.valueNode||u;s({location:{offset:f.offset,length:f.length},message:e.errors[0],severity:ee.Warning})}else s({location:{offset:c.offset,length:1},message:e.errors[0],severity:ee.Warning})}else{var l=t.validate(e.schema);l&&l.forEach(s)}_e(e.schema)&&(i=a=ee.Ignore)}if(t.syntaxErrors.forEach(function(e){e.code===Z.TrailingComma&&(e.severity=i),s(e)}),o.push.apply(o,t.externalDiagnostic),a!==ee.Ignore){var h=Ce("InvalidCommentToken","Comments are not permitted in JSON.");t.comments.forEach(function(e){s({location:e,severity:a,message:h})})}return o})},e}();function _e(e){if(e&&"object"==typeof e){if(e.allowComments)return!0;if(e.allOf)return e.allOf.some(_e)}return!1}var Ie=48,Pe=57,je=65,Ve=97,Me=102;function Ne(e){return e=Ve&&e<=Me?e-Ve+10:0)}function Fe(e){if("#"!==e[0])return null;switch(e.length){case 4:return{red:17*Ne(e.charCodeAt(1))/255,green:17*Ne(e.charCodeAt(2))/255,blue:17*Ne(e.charCodeAt(3))/255,alpha:1};case 5:return{red:17*Ne(e.charCodeAt(1))/255,green:17*Ne(e.charCodeAt(2))/255,blue:17*Ne(e.charCodeAt(3))/255,alpha:17*Ne(e.charCodeAt(4))/255};case 7:return{red:(16*Ne(e.charCodeAt(1))+Ne(e.charCodeAt(2)))/255,green:(16*Ne(e.charCodeAt(3))+Ne(e.charCodeAt(4)))/255,blue:(16*Ne(e.charCodeAt(5))+Ne(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(16*Ne(e.charCodeAt(1))+Ne(e.charCodeAt(2)))/255,green:(16*Ne(e.charCodeAt(3))+Ne(e.charCodeAt(4)))/255,blue:(16*Ne(e.charCodeAt(5))+Ne(e.charCodeAt(6)))/255,alpha:(16*Ne(e.charCodeAt(7))+Ne(e.charCodeAt(8)))/255}}return null}var De=function(){function e(e){this.schemaService=e}return e.prototype.findDocumentSymbols=function(e,t){var r=this,n=t.root;if(!n)return null;var a=e.uri;if(("vscode://defaultsettings/keybindings.json"===a||Oe(a.toLowerCase(),"/user/keybindings.json"))&&"array"===n.type){var s=[];return n.items.forEach(function(t){if("object"===t.type)for(var r=0,n=t.properties;r0;)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(e){e=this.normalizeId(e);var t=this.schemasById[e];return!!t&&(t.clearSchema(),!0)},e.prototype.normalizeId=function(e){return X.a.parse(e).toString()},e.prototype.setSchemaContributions=function(e){var t=this;if(e.schemas){var r=e.schemas;for(var n in r){var o=this.normalizeId(n);this.contributionSchemas[o]=this.addSchemaHandle(o,r[n])}}if(e.schemaAssociations){var i=e.schemaAssociations;for(var a in i){var s=i[a];this.contributionAssociations[a]=s;var c=this.getOrAddFilePatternAssociation(a);s.forEach(function(e){var r=t.normalizeId(e);c.addSchema(r)})}}},e.prototype.addSchemaHandle=function(e,t){var r=new Le(this,e,t);return this.schemasById[e]=r,r},e.prototype.getOrAddSchemaHandle=function(e,t){return this.schemasById[e]||this.addSchemaHandle(e,t)},e.prototype.getOrAddFilePatternAssociation=function(e){var t=this.filePatternAssociationById[e];return t||(t=new Ue(e),this.filePatternAssociationById[e]=t,this.filePatternAssociations.push(t)),t},e.prototype.registerExternalSchema=function(e,t,r){var n=this;void 0===t&&(t=null);var o=this.normalizeId(e);return this.registeredSchemasIds[o]=!0,t&&t.forEach(function(e){n.getOrAddFilePatternAssociation(e).addSchema(o)}),r?this.addSchemaHandle(o,r):this.getOrAddSchemaHandle(o)},e.prototype.clearExternalSchemas=function(){var e=this;for(var t in this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={},this.contributionSchemas)this.schemasById[t]=this.contributionSchemas[t],this.registeredSchemasIds[t]=!0;for(var r in this.contributionAssociations){var n=this.getOrAddFilePatternAssociation(r);this.contributionAssociations[r].forEach(function(t){var r=e.normalizeId(t);n.addSchema(r)})}},e.prototype.getResolvedSchema=function(e){var t=this.normalizeId(e),r=this.schemasById[t];return r?r.getResolvedSchema():this.promise.resolve(null)},e.prototype.loadSchema=function(e){if(!this.requestService){var t=$e("json.schema.norequestservice","Unable to load schema from '{0}'. No schema request service available",Je(e));return this.promise.resolve(new qe({},[t]))}return this.requestService(e).then(function(t){if(!t){var r=$e("json.schema.nocontent","Unable to load schema from '{0}': No content.",Je(e));return new qe({},[r])}var n,o=[];n=B(t,o);var i=o.length?[$e("json.schema.invalidFormat","Unable to parse content from '{0}': Parse error at offset {1}.",Je(e),o[0].offset)]:[];return new qe(n,i)},function(t){var r=$e("json.schema.unabletoload","Unable to load schema from '{0}': {1}",Je(e),t.toString());return new qe({},[r])})},e.prototype.resolveSchemaContent=function(e,t){var r=this,n=e.errors.slice(0),o=e.schema,i=this.contextService,a=function(e,t,r,o){var i=function(e,t){if(!t)return e;var r=e;return"/"===t[0]&&(t=t.substr(1)),t.split("/").some(function(e){return!(r=r[e])}),r}(t,o);if(i)for(var a in i)i.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(e[a]=i[a]);else n.push($e("json.schema.invalidref","$ref '{0}' in '{1}' can not be resolved.",o,r))},s=function(e,t,o,s){return i&&!/^\w+:\/\/.*/.test(t)&&(t=i.resolveRelativePath(t,s)),t=r.normalizeId(t),r.getOrAddSchemaHandle(t).getUnresolvedSchema().then(function(r){if(r.errors.length){var i=o?t+"#"+o:t;n.push($e("json.schema.problemloadingref","Problems loading reference '{0}': {1}",i,r.errors[0]))}return a(e,r.schema,t,o),c(e,r.schema,t)})},c=function(e,t,n){if(!e||"object"!=typeof e)return Promise.resolve(null);for(var o=[e],i=[],c=[],u=function(e){for(;e.$ref;){var r=e.$ref.split("#",2);if(delete e.$ref,r[0].length>0)return void c.push(s(e,r[0],r[1],n));a(e,t,n,r[1])}!function(){for(var e=[],t=0;t=0||(i.push(f),u(f))}return r.promise.all(c)};return c(o,o,t).then(function(e){return new He(o,n)})},e.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&"object"===t.root.type){var r=t.root.properties.filter(function(e){return"$schema"===e.keyNode.value&&e.valueNode&&"string"===e.valueNode.type});if(r.length>0){var n=ge(r[0].valueNode);if(n&&function(e,t){if(e.length0?this.createCombinedSchema(e,a).getResolvedSchema():this.promise.resolve(null)},e.prototype.createCombinedSchema=function(e,t){if(1===t.length)return this.getOrAddSchemaHandle(t[0]);var r="schemaservice://combinedSchema/"+encodeURIComponent(e),n={allOf:t.map(function(e){return{$ref:e}})};return this.addSchemaHandle(r,n)},e}();function Je(e){try{var t=X.a.parse(e);if("file"===t.scheme)return t.fsPath}catch(e){}return e}function ze(e){var t=e.promiseConstructor||Promise,r=new Be(e.schemaRequestService,e.workspaceContext,t);r.setSchemaContributions(Re);var n=new Te(r,e.contributions,t),i=new Ae(r,e.contributions,t),a=new De(r),s=new we(r,t);return{configure:function(e){r.clearExternalSchemas(),e.schemas&&e.schemas.forEach(function(e){r.registerExternalSchema(e.uri,e.fileMatch,e.schema)}),s.configure(e)},resetSchema:function(e){return r.onResourceChange(e)},doValidation:s.doValidation.bind(s),parseJSONDocument:function(e){return Se(e,{collectComments:!0})},newJSONDocument:function(e,t){return function(e,t){return void 0===t&&(t=[]),new be(e,[],[],t)}(e,t)},doResolve:n.doResolve.bind(n),doComplete:n.doComplete.bind(n),findDocumentSymbols:a.findDocumentSymbols.bind(a),findColorSymbols:function(e,t){return a.findDocumentColors(e,t).then(function(e){return e.map(function(e){return e.range})})},findDocumentColors:a.findDocumentColors.bind(a),getColorPresentations:a.getColorPresentations.bind(a),doHover:i.doHover.bind(i),format:function(e,t,r){var n=void 0;if(t){var i=e.offsetAt(t.start);n={offset:i,length:e.offsetAt(t.end)-i}}var a={tabSize:r?r.tabSize:4,insertSpaces:!r||r.insertSpaces,eol:"\n"};return function(e,t,r){return $(e,t,r)}(e.getText(),n,a).map(function(t){return u.replace(o.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length)),t.content)})}}}var Ke=monaco.Promise,Ge=function(){function e(e){this.wrapped=new monaco.Promise(e)}return e.prototype.then=function(e,t){return this.wrapped.then(e,t)},e.prototype.getWrapped=function(){return this.wrapped},e.prototype.cancel=function(){this.wrapped.cancel()},e.resolve=function(e){return monaco.Promise.as(e)},e.reject=function(e){return monaco.Promise.wrapError(e)},e.all=function(e){return monaco.Promise.join(e)},e}(),Ze=function(){function e(e,t){this._ctx=e,this._languageSettings=t.languageSettings,this._languageId=t.languageId,this._languageService=ze({promiseConstructor:Ge}),this._languageService.configure(this._languageSettings)}return e.prototype.doValidation=function(e){var t=this._getTextDocument(e);if(t){var r=this._languageService.parseJSONDocument(t);return this._languageService.doValidation(t,r)}return Ke.as([])},e.prototype.doComplete=function(e,t){var r=this._getTextDocument(e),n=this._languageService.parseJSONDocument(r);return this._languageService.doComplete(r,t,n)},e.prototype.doResolve=function(e){return this._languageService.doResolve(e)},e.prototype.doHover=function(e,t){var r=this._getTextDocument(e),n=this._languageService.parseJSONDocument(r);return this._languageService.doHover(r,t,n)},e.prototype.format=function(e,t,r){var n=this._getTextDocument(e),o=this._languageService.format(n,t,r);return Ke.as(o)},e.prototype.resetSchema=function(e){return Ke.as(this._languageService.resetSchema(e))},e.prototype.findDocumentSymbols=function(e){var t=this._getTextDocument(e),r=this._languageService.parseJSONDocument(t),n=this._languageService.findDocumentSymbols(t,r);return Ke.as(n)},e.prototype.findDocumentColors=function(e){var t=this._getTextDocument(e),r=this._languageService.parseJSONDocument(t),n=this._languageService.findDocumentColors(t,r);return Ke.as(n)},e.prototype.getColorPresentations=function(e,t,r){var n=this._getTextDocument(e),o=this._languageService.parseJSONDocument(n),i=this._languageService.getColorPresentations(n,o,t,r);return Ke.as(i)},e.prototype._getTextDocument=function(e){for(var t=0,r=this._ctx.getMirrorModels();t0;){var o=t.pop(),c=o.id,i=o.chain;if((a=P[c])&&!a.hot._selfAccepted){if(a.hot._selfDeclined)return{type:"self-declined",chain:i,moduleId:c};if(a.hot._main)return{type:"unaccepted",chain:i,moduleId:c};for(var d=0;d ")),j.type){case"self-declined":n.onDeclined&&n.onDeclined(j),n.ignoreDeclined||(D=new Error("Aborted because of self decline: "+j.moduleId+I));break;case"declined":n.onDeclined&&n.onDeclined(j),n.ignoreDeclined||(D=new Error("Aborted because of declined dependency: "+j.moduleId+" in "+j.parentId+I));break;case"unaccepted":n.onUnaccepted&&n.onUnaccepted(j),n.ignoreUnaccepted||(D=new Error("Aborted because "+l+" is not accepted"+I));break;case"accepted":n.onAccepted&&n.onAccepted(j),E=!0;break;case"disposed":n.onDisposed&&n.onDisposed(j),H=!0;break;default:throw new Error("Unexception type "+j.type)}if(D)return p("abort"),Promise.reject(D);if(E)for(l in m[l]=h[l],f(b,j.outdatedModules),j.outdatedDependencies)Object.prototype.hasOwnProperty.call(j.outdatedDependencies,l)&&(v[l]||(v[l]=[]),f(v[l],j.outdatedDependencies[l]));H&&(f(b,[j.moduleId]),m[l]=w)}var k,M=[];for(t=0;t0;)if(l=U.pop(),a=P[l]){var q={},T=a.hot._disposeHandlers;for(c=0;c=0&&R.parents.splice(k,1))}}for(l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&(a=P[l]))for(S=v[l],c=0;c=0&&a.children.splice(k,1);for(l in p("apply"),o=y,m)Object.prototype.hasOwnProperty.call(m,l)&&(e[l]=m[l]);var N=null;for(l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&(a=P[l])){S=v[l];var C=[];for(t=0;t=0&&n._disposeHandlers.splice(r,1)},check:_,apply:E,status:function(e){if(!e)return u;s.push(e)},addStatusHandler:function(e){s.push(e)},removeStatusHandler:function(e){var n=s.indexOf(e);n>=0&&s.splice(n,1)},data:i[e]};return r=void 0,n}(n),parents:(a=d,d=[],a),children:[]};return e[n].call(t.exports,t,t.exports,l(n)),t.l=!0,t.exports}x.m=e,x.c=P,x.d=function(e,n,r){x.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},x.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},x.t=function(e,n){if(1&n&&(e=x(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(x.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)x.d(r,t,function(n){return e[n]}.bind(null,t));return r},x.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return x.d(n,"a",n),n},x.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},x.p="",x.h=function(){return o},l(536)(x.s=536)}({536:function(e,n,r){e.exports=function(){return new Worker(r.p+"51c25ac0adacae5e02ff.worker.js")}}}); ================================================ FILE: latest/hotReload.js ================================================ !function(e){var t=this.webpackHotUpdate;this.webpackHotUpdate=function(e,n){!function(e,t){if(!_[e]||!g[e])return;for(var n in g[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(y[n]=t[n]);0==--v&&0===b&&P()}(e,n),t&&t(e,n)};var n,r=!0,o="a26353f7167734308499",i=1e4,c={},u=[],a=[];function l(e){var t=E[e];if(!t)return S;var r=function(r){return t.hot.active?(E[r]?-1===E[r].parents.indexOf(e)&&E[r].parents.push(e):(u=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),u=[]),S(r)},o=function(e){return{configurable:!0,enumerable:!0,get:function(){return S[e]},set:function(t){S[e]=t}}};for(var i in S)Object.prototype.hasOwnProperty.call(S,i)&&"e"!==i&&"t"!==i&&Object.defineProperty(r,i,o(i));return r.e=function(e){return"ready"===s&&d("prepare"),b++,S.e(e).then(t,function(e){throw t(),e});function t(){b--,"prepare"===s&&(m[e]||j(e),0===b&&0===v&&P())}},r.t=function(e,t){return 1&t&&(e=r(e)),S.t(e,-2&t)},r}var f=[],s="idle";function d(e){s=e;for(var t=0;t0;){var o=r.pop(),i=o.id,c=o.chain;if((a=E[i])&&!a.hot._selfAccepted){if(a.hot._selfDeclined)return{type:"self-declined",chain:c,moduleId:i};if(a.hot._main)return{type:"unaccepted",chain:c,moduleId:i};for(var u=0;u ")),j.type){case"self-declined":t.onDeclined&&t.onDeclined(j),t.ignoreDeclined||(P=new Error("Aborted because of self decline: "+j.moduleId+D));break;case"declined":t.onDeclined&&t.onDeclined(j),t.ignoreDeclined||(P=new Error("Aborted because of declined dependency: "+j.moduleId+" in "+j.parentId+D));break;case"unaccepted":t.onUnaccepted&&t.onUnaccepted(j),t.ignoreUnaccepted||(P=new Error("Aborted because "+l+" is not accepted"+D));break;case"accepted":t.onAccepted&&t.onAccepted(j),x=!0;break;case"disposed":t.onDisposed&&t.onDisposed(j),k=!0;break;default:throw new Error("Unexception type "+j.type)}if(P)return d("abort"),Promise.reject(P);if(x)for(l in m[l]=y[l],p(b,j.outdatedModules),j.outdatedDependencies)Object.prototype.hasOwnProperty.call(j.outdatedDependencies,l)&&(v[l]||(v[l]=[]),p(v[l],j.outdatedDependencies[l]));k&&(p(b,[j.moduleId]),m[l]=g)}var R,A=[];for(r=0;r0;)if(l=H.pop(),a=E[l]){var $={},M=a.hot._disposeHandlers;for(i=0;i=0&&q.parents.splice(R,1))}}for(l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&(a=E[l]))for(I=v[l],i=0;i=0&&a.children.splice(R,1);for(l in d("apply"),o=h,m)Object.prototype.hasOwnProperty.call(m,l)&&(e[l]=m[l]);var T=null;for(l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&(a=E[l])){I=v[l];var U=[];for(r=0;r=0&&t._disposeHandlers.splice(n,1)},check:O,apply:x,status:function(e){if(!e)return s;f.push(e)},addStatusHandler:function(e){f.push(e)},removeStatusHandler:function(e){var t=f.indexOf(e);t>=0&&f.splice(t,1)},data:c[e]};return n=void 0,t}(t),parents:(a=u,u=[],a),children:[]};return e[t].call(r.exports,r,r.exports,l(t)),r.l=!0,r.exports}S.m=e,S.c=E,S.d=function(e,t,n){S.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},S.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},S.t=function(e,t){if(1&t&&(e=S(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(S.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)S.d(n,r,function(t){return e[t]}.bind(null,r));return n},S.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return S.d(t,"a",t),t},S.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},S.p="",S.h=function(){return o},l(259)(S.s=259)}({259:function(e,t,n){"use strict";e.exports=n(260)},260:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(3))&&"object"==typeof r&&"default"in r?r.default:r,i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},u=function(e){function t(){return i(this,t),c(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.render=function(){return o.Children.only(this.props.children)},t}(o.Component);t.AppContainer=u,t.hot=function(){return function(e){return e}},t.areComponentsEqual=function(e,t){return e===t},t.setConfig=function(){},t.cold=function(e){return e}},3:function(e,t,n){"use strict";e.exports=n(70)},52:function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,c,u=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;aR.length&&R.push(e)}function I(e,t,n,r){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var i=!1;if(null===e)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case a:case l:i=!0}}if(i)return n(r,e,""===t?"."+H(e,0):t),1;if(i=0,t=""===t?".":t+":",Array.isArray(e))for(var c=0;c","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"files":["icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-57x57.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-60x60.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-72x72.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-76x76.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-114x114.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-120x120.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-144x144.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-152x152.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-167x167.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-180x180.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-icon-precomposed.png","icons-24a6ef8280df161e3d389800fa2107ae/favicon-16x16.png","icons-24a6ef8280df161e3d389800fa2107ae/favicon-32x32.png","icons-24a6ef8280df161e3d389800fa2107ae/favicon.ico","icons-24a6ef8280df161e3d389800fa2107ae/android-chrome-36x36.png","icons-24a6ef8280df161e3d389800fa2107ae/android-chrome-48x48.png","icons-24a6ef8280df161e3d389800fa2107ae/android-chrome-72x72.png","icons-24a6ef8280df161e3d389800fa2107ae/android-chrome-96x96.png","icons-24a6ef8280df161e3d389800fa2107ae/android-chrome-144x144.png","icons-24a6ef8280df161e3d389800fa2107ae/android-chrome-192x192.png","icons-24a6ef8280df161e3d389800fa2107ae/android-chrome-256x256.png","icons-24a6ef8280df161e3d389800fa2107ae/android-chrome-384x384.png","icons-24a6ef8280df161e3d389800fa2107ae/android-chrome-512x512.png","icons-24a6ef8280df161e3d389800fa2107ae/firefox_app_60x60.png","icons-24a6ef8280df161e3d389800fa2107ae/firefox_app_128x128.png","icons-24a6ef8280df161e3d389800fa2107ae/firefox_app_512x512.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-startup-image-320x460.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-startup-image-640x1096.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-startup-image-640x920.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-startup-image-748x1024.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-startup-image-750x1294.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-startup-image-768x1004.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-startup-image-1182x2208.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-startup-image-1242x2148.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-startup-image-1496x2048.png","icons-24a6ef8280df161e3d389800fa2107ae/apple-touch-startup-image-1536x2008.png","icons-24a6ef8280df161e3d389800fa2107ae/manifest.json","icons-24a6ef8280df161e3d389800fa2107ae/manifest.webapp"]}} ================================================ FILE: latest/icons-24a6ef8280df161e3d389800fa2107ae/manifest.json ================================================ { "name": "L1", "short_name": "L1", "description": null, "dir": "auto", "lang": "en-US", "display": "standalone", "orientation": "any", "start_url": "/?homescreen=1", "background_color": "#fff", "icons": [ { "src": "android-chrome-36x36.png", "sizes": "36x36", "type": "image/png" }, { "src": "android-chrome-48x48.png", "sizes": "48x48", "type": "image/png" }, { "src": "android-chrome-72x72.png", "sizes": "72x72", "type": "image/png" }, { "src": "android-chrome-96x96.png", "sizes": "96x96", "type": "image/png" }, { "src": "android-chrome-144x144.png", "sizes": "144x144", "type": "image/png" }, { "src": "android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" }, { "src": "android-chrome-256x256.png", "sizes": "256x256", "type": "image/png" }, { "src": "android-chrome-384x384.png", "sizes": "384x384", "type": "image/png" }, { "src": "android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" } ] } ================================================ FILE: latest/icons-24a6ef8280df161e3d389800fa2107ae/manifest.webapp ================================================ { "version": "1.0", "name": "L1", "description": null, "icons": { "60": "firefox_app_60x60.png", "128": "firefox_app_128x128.png", "512": "firefox_app_512x512.png" }, "developer": { "name": null, "url": null } } ================================================ FILE: latest/index.html ================================================ Tensor Studio
    ================================================ FILE: latest/json.worker.js ================================================ !function(e){var n=this.webpackHotUpdate;this.webpackHotUpdate=function(e,r){!function(e,n){if(!O[e]||!w[e])return;for(var r in w[e]=!1,n)Object.prototype.hasOwnProperty.call(n,r)&&(h[r]=n[r]);0==--v&&0===b&&D()}(e,r),n&&n(e,r)};var r,t=!0,o="a26353f7167734308499",c=1e4,i={},d=[],a=[];function l(e){var n=P[e];if(!n)return x;var t=function(t){return n.hot.active?(P[t]?-1===P[t].parents.indexOf(e)&&P[t].parents.push(e):(d=[e],r=t),-1===n.children.indexOf(t)&&n.children.push(t)):(console.warn("[HMR] unexpected require("+t+") from disposed module "+e),d=[]),x(t)},o=function(e){return{configurable:!0,enumerable:!0,get:function(){return x[e]},set:function(n){x[e]=n}}};for(var c in x)Object.prototype.hasOwnProperty.call(x,c)&&"e"!==c&&"t"!==c&&Object.defineProperty(t,c,o(c));return t.e=function(e){return"ready"===u&&p("prepare"),b++,x.e(e).then(n,function(e){throw n(),e});function n(){b--,"prepare"===u&&(m[e]||j(e),0===b&&0===v&&D())}},t.t=function(e,n){return 1&n&&(e=t(e)),x.t(e,-2&n)},t}var s=[],u="idle";function p(e){u=e;for(var n=0;n0;){var o=t.pop(),c=o.id,i=o.chain;if((a=P[c])&&!a.hot._selfAccepted){if(a.hot._selfDeclined)return{type:"self-declined",chain:i,moduleId:c};if(a.hot._main)return{type:"unaccepted",chain:i,moduleId:c};for(var d=0;d ")),j.type){case"self-declined":n.onDeclined&&n.onDeclined(j),n.ignoreDeclined||(D=new Error("Aborted because of self decline: "+j.moduleId+I));break;case"declined":n.onDeclined&&n.onDeclined(j),n.ignoreDeclined||(D=new Error("Aborted because of declined dependency: "+j.moduleId+" in "+j.parentId+I));break;case"unaccepted":n.onUnaccepted&&n.onUnaccepted(j),n.ignoreUnaccepted||(D=new Error("Aborted because "+l+" is not accepted"+I));break;case"accepted":n.onAccepted&&n.onAccepted(j),E=!0;break;case"disposed":n.onDisposed&&n.onDisposed(j),H=!0;break;default:throw new Error("Unexception type "+j.type)}if(D)return p("abort"),Promise.reject(D);if(E)for(l in m[l]=h[l],f(b,j.outdatedModules),j.outdatedDependencies)Object.prototype.hasOwnProperty.call(j.outdatedDependencies,l)&&(v[l]||(v[l]=[]),f(v[l],j.outdatedDependencies[l]));H&&(f(b,[j.moduleId]),m[l]=w)}var k,M=[];for(t=0;t0;)if(l=U.pop(),a=P[l]){var q={},T=a.hot._disposeHandlers;for(c=0;c=0&&R.parents.splice(k,1))}}for(l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&(a=P[l]))for(S=v[l],c=0;c=0&&a.children.splice(k,1);for(l in p("apply"),o=y,m)Object.prototype.hasOwnProperty.call(m,l)&&(e[l]=m[l]);var N=null;for(l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&(a=P[l])){S=v[l];var C=[];for(t=0;t=0&&n._disposeHandlers.splice(r,1)},check:_,apply:E,status:function(e){if(!e)return u;s.push(e)},addStatusHandler:function(e){s.push(e)},removeStatusHandler:function(e){var n=s.indexOf(e);n>=0&&s.splice(n,1)},data:i[e]};return r=void 0,n}(n),parents:(a=d,d=[],a),children:[]};return e[n].call(t.exports,t,t.exports,l(n)),t.l=!0,t.exports}x.m=e,x.c=P,x.d=function(e,n,r){x.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},x.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},x.t=function(e,n){if(1&n&&(e=x(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(x.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)x.d(r,t,function(n){return e[n]}.bind(null,t));return r},x.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return x.d(n,"a",n),n},x.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},x.p="",x.h=function(){return o},l(537)(x.s=537)}({537:function(e,n,r){e.exports=function(){return new Worker(r.p+"b339297726b01d858501.worker.js")}}}); ================================================ FILE: package.json ================================================ { "name": "l1-tensor-studio", "version": "0.0.1", "description": "L1: Tensor Studio", "main": "index.js", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/mlajtos/L1.git" }, "scripts": { "dev": "webpack-dev-server --content-base dist/ --mode development", "build": "webpack-cli --mode production --progress", "serve": "http-server -p 7171 dist/", "clean": "rm -rf latest", "move": "mv dist latest", "git:add-build": "git add latest", "git:commit-build": "git commit -m '🚀 Deploy'", "git:push": "git push", "deploy": "run-s build clean move git:add-build git:commit-build git:push" }, "dependencies": { "@tensorflow/tfjs": "^0.12.4", "@types/lodash-es": "^4.17.1", "buffer": "^5.2.0", "dedent": "^0.7.0", "firacode": "https://github.com/tonsky/FiraCode", "fontfaceobserver": "^2.0.13", "js-base64": "^2.4.8", "lodash-es": "^4.17.10", "mnist": "^1.1.0", "monaco-editor": "^0.13.1", "normalize.css": "^8.0.0", "numeral": "^2.0.6", "ohm-js": "0.14.0", "ramda": "^0.25.0", "react": "16.4.2", "react-dom": "16.4.2", "rxjs": "^6.2.2" }, "devDependencies": { "@babel/core": "^7.0.0-beta.55", "@babel/plugin-proposal-class-properties": "^7.0.0-beta.55", "@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.55", "@babel/plugin-transform-runtime": "^7.0.0-beta.55", "@babel/polyfill": "^7.0.0-beta.55", "@babel/preset-env": "^7.0.0-beta.55", "@babel/preset-react": "^7.0.0-beta.55", "@babel/runtime": "^7.0.0-beta.55", "babel-loader": "^8.0.0-beta.4", "buffer-loader": "^0.0.1", "css-loader": "^1.0.0", "favicons-webpack-plugin": "^0.0.9", "file-loader": "^1.1.11", "html-webpack-plugin": "^3.2.0", "loader-utils": "^1.1.0", "node-sass": "^4.9.2", "npm-run-all": "^4.1.3", "raw-loader": "^0.5.1", "react-hot-loader": "^4.3.4", "sass-loader": "^7.1.0", "style-loader": "^0.21.0", "url-loader": "^1.0.1", "webpack": "^4.16.3", "webpack-bundle-analyzer": "^2.13.1", "webpack-cli": "^3.1.0", "webpack-dev-server": "^3.1.5", "worker-loader": "^2.0.0" } } ================================================ FILE: src/__tests__/0-tensor_literals/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import assert from "assert" import Evaluator from "../../components/Evaluator" const source = ` a: 1 ` const evaluationResult = Evaluator.evaluateSync(source) const actual = evaluationResult.computedValues const expected = { a: tf.scalar(1) } assert.equal( actual.a.dataSync().toString(), expected.a.dataSync().toString(), "Equality of a scalar literal" ) ================================================ FILE: src/components/Board/Code/index.js ================================================ import React, { PureComponent } from "react" import monaco from "../../MonacoEditor" import "./style.sass" export default class Code extends PureComponent { state = { colorizedValue: null, } static defaultProps = { language: "L1" } _mounted = false colorize = async (value) => { const stringValue = "" + value const colorizedValue = await monaco.editor.colorize(stringValue, this.props.language) if (this._mounted) { this.setState({ colorizedValue }) } } componentDidUpdate() { this.colorize(this.props.children) } componentDidMount() { this._mounted = true this.colorize(this.props.children) } componentWillUnmount() { this._mounted = false } render() { if (!this.state.colorizedValue) { return
    {this.props.children}
    } else { return
    } } } ================================================ FILE: src/components/Board/Code/style.sass ================================================ .codeHighlight font-family: "Fira Code" ================================================ FILE: src/components/Board/Error/index.js ================================================ import React from "react" import PropertyWrapper from "../PropertyWrapper" import "./style.sass" export default (props) => (
    {props.data.message}
    ) ================================================ FILE: src/components/Board/Error/style.sass ================================================ .property.error background: #fadcd9 border-color: hsl(3, 36%, 73%) .error-content color: #7d2116 ================================================ FILE: src/components/Board/Function/index.js ================================================ import React from "react" import PropertyWrapper from "../PropertyWrapper" import "./style.sass" export default (props) => (
    λ
    ) ================================================ FILE: src/components/Board/Function/style.sass ================================================ .function-content font-size: xx-large text-align: center align-self: center flex: 1 color: darkgray ================================================ FILE: src/components/Board/Markdown/index.js ================================================ import React, { PureComponent } from "react" import { isString } from "lodash-es" import { Base64 } from "js-base64" import monaco, { renderMarkdown } from "../../MonacoEditor" import "./style.sass" const markdownToHTML = (value) => { const result = renderMarkdown({ value }, { inline: false, codeBlockRenderer: async function (languageAlias = "L1", value) { const codeblock = await monaco.editor.colorize(value, languageAlias) return `
    ${codeblock}
    ` } }) return result } export default class Markdown extends PureComponent { _containerElement = null _colorizedElement = null colorize = async (value) => { if (!this._containerElement) { return } if (!isString(value)) { return } const stringValue = "" + value const colorizedElement = markdownToHTML(stringValue) if (this._colorizedElement) { this._containerElement.replaceChild(colorizedElement, this._colorizedElement) } else { this._containerElement.appendChild(colorizedElement) } this._colorizedElement = colorizedElement } componentDidUpdate() { this.colorize(this.props.children) } componentDidMount() { this._mounted = true this.colorize(this.props.children) } componentWillUnmount() { this._mounted = false } render() { return
    this._containerElement = e} className="property markdown" /> } } ================================================ FILE: src/components/Board/Markdown/style.sass ================================================ .markdown font-family: "Helvetica Neue", "Helvetica", "Segoe UI", Arial, sans-serif width: 100% grid-column-start: 1 grid-column-end: -1 display: block line-height: 1.5em box-sizing: border-box padding: 15px &:hover background-color: white !important > * width: 100% box-sizing: border-box h1, h2, h3, h4, h5, h6 margin-top: 24px margin-bottom: 16px font-weight: 600 line-height: 1.25 &:first-child margin-top: 0 h1 font-size: 1.8em h1, h2 padding-bottom: 0.3em border-bottom: 1px solid #eaecef .code, code font-family: "Fira Code" padding: 0.5em 1em margin: 0.5em 0 font-size: 85% background-color: #f6f8fa overflow: auto border-radius: 5px position: relative code padding: 0.3em margin: initial ol, ul padding-left: 2em blockquote margin: 0 margin-left: 15px padding: 0 1em color: #6a737d border-left: 0.25em solid #dfe2e5 .codeContainer .runButton position: absolute right: 0 top: 0 right: 0 bottom: 0 vertical-align: top border-radius: 0 8px 8px 0 border: 1px solid darkgray background-color: #eee padding: 0 1em font-size: 1.1em cursor: pointer font-weight: bold color: #333 outline: none background-color: rgba(0, 160, 236, 0.05) border-color: rgba(15, 143, 255, 0.69) color: rgba(15, 143, 255, 0.69) mix-blend-mode: multiply border-width: 0 &:hover filter: invert(1) ================================================ FILE: src/components/Board/Object/index.js ================================================ import React, { PureComponent } from "react" import { get, has } from "lodash-es" import ObjectProperty from "../ObjectProperty" import PropertyWrapper from "../PropertyWrapper" import Markdown from "../Markdown" import Symbols from "../../Interpreter/symbols" import "./style.sass" const _m = Symbols.meta const _doc = Symbols.doc /* `Object.betterEntries(obj)` returns array of triplets [value, key, obj], so it is aligned with `Array.filter` and `Array.map` with signatures of [elem, index, array] */ Object.betterEntries = (obj) => { const entries = Object.entries(obj) return entries.map(([key, value]) => [value, key, obj]) } // use _.get const isSilent = ([value, key, props]) => !(props[_m] && props[_m][key] && props[_m][key].silent) export default class ObjectVis extends PureComponent { render() { const { data } = this.props const props = Object.betterEntries(data) .filter(isSilent) .map(([value, key, props]) => { // use _.get const _meta = (props[_m] && props[_m][key]) ? props[_m][key] : null return ( ) }) const hasDoc = data.hasOwnProperty(Symbols.doc) const doc = hasDoc ? {data[_doc]} : null return (
    {doc} {props}
    ) } } ================================================ FILE: src/components/Board/Object/style.sass ================================================ .properties display: grid flex: 1 overflow: auto grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)) grid-gap: 0.5em grid-auto-flow: dense align-items: stretch .property.object grid-column-start: 1 grid-column-end: -1 .property.unknown $opacity: 0.5 $color1: rgba(darkgray, $opacity) $color2: rgba(lightgray, $opacity) mix-blend-mode: normal background: repeating-linear-gradient(135deg, $color1, $color1 20px, $color2 20px, $color2 40px) background-size: 56px 56px animation: danger linear 2s infinite @keyframes danger 0% background-position: 0 0 100% background-position: 56px 0 ================================================ FILE: src/components/Board/ObjectProperty/index.js ================================================ import React, { PureComponent } from "react" import * as tf from "@tensorflow/tfjs-core" import { isObject, isFunction, stubTrue, isString, isNumber, isBoolean } from "lodash-es" import { Observable } from "rxjs" import TensorVis from "../Tensor" import ScalarVis from "../Scalar" import FunctionVis from "../Function" import UnknownVis from "../Unknown" import PromiseVis from "../Promise" import ObservableVis from "../Observable" import ObjectVis from "../Object" import ErrorVis from "../Error" import PropertyWrapper from "../PropertyWrapper" const isUndefined = (value) => (value === undefined) const isNull = (value) => (value === null) const isPromise = (value) => (value.toString() === "[object Promise]") const isTensor = (value) => value instanceof tf.Tensor const isScope = (value) => (isObject(value) && !isPromise(value)) const isError = (value) => value instanceof Error const isObservable = (value) => value instanceof Observable const StringVis = (props) => (
    {props.data}
    ) const NumberVis = (props) => (
    {props.data}
    ) const BooleanVis = (props) => (
    {props.data ? "True" : "False"}
    ) const UndefinedVis = (props) => ( ) const NullVis = (props) => ( ) export default class ObjectProperty extends PureComponent { visualizations = [ [isUndefined, UndefinedVis ], [isNull, NullVis ], [isBoolean, BooleanVis ], [isError, ErrorVis ], [isString, StringVis ], [isNumber, NumberVis ], [isTensor, TensorVis ], [isFunction, FunctionVis ], [isObservable, ObservableVis ], [isScope, ObjectVis ], [isPromise, PromiseVis ], [stubTrue, UnknownVis ], ] valueToVis = value => this.visualizations.find(([cond, result]) => cond(value))[1] render() { const Component = this.valueToVis(this.props.data) return ( ) } } ================================================ FILE: src/components/Board/Observable/index.js ================================================ import React, { PureComponent } from "react" import ObjectProperty from "../ObjectProperty" import "./style.sass" export default class Observable extends PureComponent { state = { data: null, value: undefined, error: undefined, completed: false } _mounted = false onNext = (value) => this.setState({ value, error: undefined }) onError = (error) => this.setState({ value: undefined, error }) onCompleted = () => this.setState({ completed: true }) componentDidMount() { this._mounted = true this.subscription = this.props.data.subscribe(this.onNext, this.onError, this.onCompleted) } static getDerivedStateFromProps(nextProps, prevState) { if (nextProps.data !== prevState.data) { return { data: nextProps.data } } return null } componentDidUpdate = (prevProps, prevState) => { if (prevState.data !== this.state.data) { this.subscription.unsubscribe() this.subscription = this.state.data.subscribe(this.onNext, this.onError, this.onCompleted) } } componentWillUnmount() { this._mounted = false this.subscription.unsubscribe() } render = () => (
    ) } ================================================ FILE: src/components/Board/Observable/style.sass ================================================ .observable //border: 1px solid red border-radius: 5px padding: 1px display: flex &.error //border: 3px solid red ================================================ FILE: src/components/Board/Promise/index.js ================================================ import React, { PureComponent } from "react" import ObjectProperty from "../ObjectProperty" import "./style.sass" export default class Promise extends PureComponent { state = { data: null, resolved: false } _mounted = false resolve() { this.props.data.then(data => { if (this._mounted) { this.setState({ data, resolved: true }) } }) } componentDidMount() { this._mounted = true this.resolve() } componentWillUnmount() { this._mounted = false } componentDidUpdate(prevProps) { if (prevProps.data !== this.props.data) { this.setState({ resolved: false }) this.resolve() } } render() { return (
    ) } } ================================================ FILE: src/components/Board/Promise/style.sass ================================================ .promise display: contents > * transition: filter 0.3s, box-shadow 0.3s &.resolved > * filter: none &.unresolved > * filter: saturate(0) invert(0.05) opacity(0.5) box-shadow: inset 0 0 20px 0px #bfbfbf animation: 2s infinite pulse animation-delay: 1s cursor: wait @keyframes pulse 0% box-shadow: inset 0 0 20px 0px #bfbfbf 50% box-shadow: inset 0 0 20px 10px #bfbfbf 100% box-shadow: inset 0 0 20px 0px #bfbfbf ================================================ FILE: src/components/Board/PropertyWrapper/index.js ================================================ import React, { PureComponent } from "react" import Code from "../Code" import "./style.sass" export default class PropertyWrapper extends PureComponent { onMouseOver = (e) => { // console.log(this.props.source) } render() { const name = this.props.name || "" const symbol = this.props.symbol || "" const type = this.props.type || "" return (
    {name}
    {symbol}
    {this.props.children}
    ) } } ================================================ FILE: src/components/Board/PropertyWrapper/style.sass ================================================ .property display: grid grid-template-rows: max-content font-family: "Fira Code" padding: 0.5em background-color: white border-radius: 5px box-sizing: border-box border: 1px solid lightgray flex: 1 &:hover, &:focus-within background-color: rgba(0, 160, 236, 0.05) border-color: hsla(208, 100%, 53%, 0.69) mix-blend-mode: screen .header display: flex flex-direction: row text-align: left margin-bottom: 0.1em .cell flex: 1 &.symbol text-align: right font-size: 0.6em display: flex align-items: center justify-content: flex-end flex: none .content // overflow: hidden display: flex ================================================ FILE: src/components/Board/Scalar/index.js ================================================ import React, { PureComponent } from "react" import Code from "../Code" import { formatNumber } from "../Tensor" import "./style.sass" export default class ScalarVis extends PureComponent { state = { numericValue: 0 } static getDerivedStateFromProps(nextProps, prevState) { return { numericValue: nextProps.data.dataSync()[0] } } onKeyDown = (e) => { console.log(e) let delta = 1 if (e.key === "ArrowUp") { } else if (e.key === "ArrowDown") { delta *= -1 } else { return } e.preventDefault() if (e.metaKey) { delta *= 100 } if (e.shiftKey) { delta *= 10 } if (e.altKey) { delta *= 0.1 } const newValue = this.state.numericValue + delta this.setState({ numericValue: newValue }) } render() { return (
    {formatNumber(this.state.numericValue)}
    ) } } ================================================ FILE: src/components/Board/Scalar/style.sass ================================================ .scalar-input flex: 1 position: relative font-size: larger max-height: 2em &:hover background-color: rgba(0, 160, 236, 0.05) mix-blend-mode: screen border-color: rgba(15, 143, 255, 1) cursor: pointer &:focus outline: none background-color: white !important border-color: rgba(15, 143, 255, 1) !important &:after content: "↑↓" position: absolute right: 0.5em height: 1em top: 0 bottom: 0 font-size: smaller color: #9e9e9e margin: auto ================================================ FILE: src/components/Board/Tensor/CanvasTensor/index.js ================================================ import React, { PureComponent } from "react" import { isFunction } from "lodash-es" import { normalizeTensor } from "../index" import "./style.sass" export default class CanvasTensor extends PureComponent { canvas = null _mount = (el) => { this.canvas = el if (this.canvas) { this._draw(this.props.data) } } _draw = async (tensor) => { const canvas = this.canvas const context = canvas.getContext("2d") const rank = tensor.rank const fn = this[`_createImageData${rank}D`] if (!isFunction(fn)) { throw Error(`Drawing function is not available.`) } const imageData = await fn(tensor, context) // console.log(imageData) canvas.width = imageData.width canvas.height = imageData.height window.requestAnimationFrame(() => context.putImageData(imageData, 0, 0)) } _createImageData0D = async (tensor, context) => { const imageData = context.createImageData(1, 1) return imageData } _createImageData1D = async (tensor, context) => { let [height, width] = ((tensorShape) => { const [w = 1, h = 1] = tensorShape return [h, w] })(tensor.shape) const imageData = context.createImageData(width, height) const normalized = await normalizeTensor(tensor) const data = await normalized.data() for (let i = 0; i < tensor.size; i++) { const j = i * 4 const v = Math.round(data[i]) const valid = !isNaN(v) imageData.data[j + 0] = valid ? v : 255 imageData.data[j + 1] = valid ? v : 0 imageData.data[j + 2] = valid ? v : 0 imageData.data[j + 3] = 255 } return imageData } _createImageData2D = async (tensor, context) => { let [height, width] = ((tensorShape) => { const [h = 1, w = 1] = tensorShape return [h, w] })(tensor.shape) const imageData = context.createImageData(width, height) const normalized = await normalizeTensor(tensor) const data = await normalized.data() for (let i = 0; i < tensor.size; i++) { const j = i * 4 const v = Math.round(data[i]) const valid = !isNaN(v) imageData.data[j + 0] = valid ? v : 255 imageData.data[j + 1] = valid ? v : 0 imageData.data[j + 2] = valid ? v : 0 imageData.data[j + 3] = 255 } return imageData } _createImageData3D = async (tensor, context) => { return this._createImageData2D(tensor, context) } componentDidUpdate(prevProps, prevState) { this._draw(this.props.data) } render() { return (
    ) } } ================================================ FILE: src/components/Board/Tensor/CanvasTensor/style.sass ================================================ div.canvas flex: 1 align-items: center justify-content: center display: flex .tensor-canvas image-rendering: pixelated box-sizing: border-box margin: 0.2em filter: drop-shadow(0px 0px 1px darkgray) object-fit: fill min-width: 75% max-width: 100% max-height: 200px min-height: 100% ================================================ FILE: src/components/Board/Tensor/Stats/index.js ================================================ import React, { PureComponent } from "react" import Code from "../../Code" import { formatNumber } from ".." import "./style.sass" export default class Stats extends PureComponent { state = { data: null, min: 0, max: 0, mean: 0, computing: false, revisionId: 0 } static getDerivedStateFromProps(nextProps, prevState) { if (nextProps.data === prevState.data && nextProps.revisionId === prevState.revisionId) { return null } const newState = { data: nextProps.data, revisionId: nextProps.revisionId, computing: true } return newState } componentDidMount() { this.updateStats() this._mounted = true } componentWillUnmount() { this._mounted = false } componentDidUpdate(prevProps, prevState) { if (prevState.data !== this.state.data || prevState.revisionId !== this.state.revisionId) { this.updateStats() } } async updateStats() { const updatedState = { min: (await this.props.data.min().data())[0], max: (await this.props.data.max().data())[0], mean: (await this.props.data.mean().data())[0], computing: false } if (this._mounted) { this.setState(updatedState) } } render() { return (
    {"[" + this.state.data.shape.map(formatNumber).join(" ") + "]"} {formatNumber(this.state.data.size)} {formatNumber(this.state.data.rank)} {formatNumber(+this.state.mean)} {formatNumber(this.state.max - this.state.min)} {formatNumber(+this.state.min)} {formatNumber(+this.state.max)} {/* { this.state.computing ? "Computing..." : null} */}
    ) } } const Field = ({ name, children }) => (
    {name}
    {children}
    ) ================================================ FILE: src/components/Board/Tensor/Stats/style.sass ================================================ .info margin-left: 0.5em flex: 1 .field font-size: smaller display: flex align-items: baseline .label, .value flex: 1 .value text-align: right white-space: pre font-size: smaller ================================================ FILE: src/components/Board/Tensor/SvgTensor/index.js ================================================ import React, { PureComponent } from "react" import { normalizeTensor, formatNumber } from "../index" import "./style.sass" export default class SvgTensor extends PureComponent { render = () => { const { props } = this const [height, width] = ((tensorShape) => { if (tensorShape.length === 2) { const [h = 1, w = 1] = tensorShape return [h, w] } else { const [w = 1] = tensorShape return [1, w] } })(props.data.shape) const normalized = normalizeTensor(props.data) const normalizedData = normalized.dataSync() const data = props.data.dataSync() const size = props.data.size const tileHeight = 40 const tileWidth = 40 const svgWidth = tileWidth * width const svgHeight = tileHeight * height return ( { Array.from({ length: size }, (_, i) => { const color = normalizedData[i] const bgColor = `rgb(${color}, ${color}, ${color})` const inverseRoundedValue = color > 128 ? 0 : 255 const fgColor = `rgb(${inverseRoundedValue}, ${inverseRoundedValue}, ${inverseRoundedValue})` const dx = tileWidth * (i % width) const dy = tileHeight * Math.floor(i / width) return ( {formatNumber(data[i], 1)} ) }) } ) } } ================================================ FILE: src/components/Board/Tensor/SvgTensor/style.sass ================================================ svg.svg-tensor margin: 0.2em filter: drop-shadow(0px 0px 1px darkgray) min-height: 10px max-height: 200px min-width: 100% max-width: 100% text font-size: 0.8em ================================================ FILE: src/components/Board/Tensor/index.js ================================================ import React, { PureComponent } from "react" import * as tf from "@tensorflow/tfjs-core" import { repeat } from "lodash-es" import numeral from "numeral" import ScalarVis from "../Scalar" import PropertyWrapper from "../PropertyWrapper" import SvgTensor from "./SvgTensor" import CanvasTensor from "./CanvasTensor" import Stats from "./Stats" import "./style.sass" export default class Tensor extends PureComponent { state = { isVariable: false, data: null, revisionId: 0 } static getDerivedStateFromProps(nextProps, prevState) { if (nextProps.data !== prevState.data) { const isVariable = (nextProps.data instanceof tf.Variable) const symbol = (isVariable ? "$" : "") + "[]" return { data: nextProps.data, isVariable, symbol, revisionId: prevState.revisionId } } return null } componentDidMount() { if (this.state.isVariable) { this.state.data.subscribe(this.update) } } componentDidUpdate(prevProps) { if (prevProps.data !== this.props.data) { if (prevProps.data instanceof tf.Variable) { prevProps.data.unsubscribe(this.update) } if (this.state.isVariable) { this.state.data.subscribe(this.update) } } } componentWillUnmount() { if (this.state.isVariable) { this.state.data.unsubscribe(this.update) } } update = () => { this.setState({ revisionId: this.state.revisionId + 1 }) } render() { if (!this.state.data) { return null } const isEmpty = (this.state.data.size === 0) const isScalar = (this.state.data.rank === 0) const Component = isEmpty ? EmptyTensor : isScalar ? ScalarVis : GenericTensor return ( ) } } const EmptyTensor = (props) => (
    Empty tensor
    ) class GenericTensor extends PureComponent { render() { const data = this.props.data return (
    { (this.props.data.size > 25) ? : }
    ) } } export const formatNumber = (number, decimalDigits = 2) => { try { return numeral(number).format(`0,0.[${repeat("0", decimalDigits)}]`).replace(/,/g, "_") } catch (e) { console.log(number, e) return "???" } } const scaleFeatures = (t, a, b) => { const min = t.min() const max = t.max() // a + ((r - min) / (max - min)) * (b - a)) return a.add(t.sub(min).div(max.sub(min)).mul(b.sub(a))) } export const normalizeTensor = (tensor) => { // r = (x - mu) const r = tensor.sub(tensor.mean()) const a = tf.scalar(-1) const b = tf.scalar(1) const normalized = scaleFeatures(r, a, b) return scaleFeatures(normalized, tf.scalar(0), tf.scalar(255)) } ================================================ FILE: src/components/Board/Tensor/style.sass ================================================ div.tensor-content display: flex flex-direction: row flex: 1 flex-wrap: wrap align-items: center div.visualization display: flex flex: 1 ================================================ FILE: src/components/Board/Unknown/index.js ================================================ import React, { PureComponent } from "react" import PropertyWrapper from "../PropertyWrapper" import "./style.sass" const Unknown = (props) => ( {/*
    Doesn't look like anything to me.
                    {JSON.stringify(props.data)}
                
    */}
    ) export default Unknown ================================================ FILE: src/components/Board/Unknown/style.sass ================================================ .WestWorldQuote font-size: small text-align: center align-self: center flex: 1 ================================================ FILE: src/components/Board/index.js ================================================ import React, { PureComponent } from "react" import Object from "./Object" import ObjectPropery from "./ObjectProperty" export default class Board extends PureComponent { render() { // if (!this.props.data) { // return null // } return ( ) } } ================================================ FILE: src/components/Board/style.sass ================================================ ================================================ FILE: src/components/Dataset/index.js ================================================ const loadFile = async (file) => { const data = await import("./data/" + file) const buffer = Buffer.from(Object.values(data)) buffer.readUInt32BE(0) // skip magic number return buffer } export const loadTestLabels = async () => { const buffer = await loadFile("t10k-labels-idx1-ubyte.bin") const length = buffer.readUInt32BE(4) const labels = Array.from({ length }, (v, i) => buffer.readUInt8(8 + i)) return labels } export const loadTestImages = async () => { const buffer = await loadFile("t10k-images-idx3-ubyte.bin") const length = buffer.readUInt32BE(4) const rows = buffer.readUInt32BE(8) const cols = buffer.readUInt32BE(12) console.log(rows, cols) const images = Array.from({ length }, (v, i) => { //const offset = 16 + Math.pow(28, 2) }) return [] // return labels // var images = _.range(m - n).map(function (i) { // var offset = 16 + Math.pow(28, 2) * i; // return _.range(28).map(function (j) { // return _.range(28).map(function (k) { // return buffer.readUInt8(offset + (28 * j) + k); // }); // }); // }); } ================================================ FILE: src/components/Editor/index.js ================================================ import React, { PureComponent } from "react" import ReactDOM from "react-dom" import { isFunction } from "lodash-es" import FontFaceObserver from "fontfaceobserver" import { Subject } from "rxjs" import { scan } from "rxjs/operators" import "./style.sass" import monaco from "../MonacoEditor" export default class Editor extends PureComponent { static defaultProps = { onChange: () => {}, onExecute: () => {}, onSave: () => {}, defaultValue: "", language: "L1", readOnly: false, tabSize: 4 } container = null editor = null decorations = [] viewZones = [] markers = [] issues = new Subject _forced = false _mount = async (el) => { this.container = el if (this.container) { const font = new FontFaceObserver("Fira Code") font.load().then(this.instantiateEditor, (e) => { console.log("Could not load the font") }) } } instantiateEditor = () => { const config = { value: this.props.content, language: this.props.language, theme: "L1", fontFamily: "Fira Code", fontSize: 16, fontLigatures: true, tabSize: this.props.tabSize, readOnly: this.props.readOnly, glyphMargin: true, // lineNumbers: false, lineNumbersMinChars: 2, lineDecorationsWidth: 0, wordWrap: "bounded", wrappingIndent: "indent", autoIndent: true, formatOnType: true, minimap: { enabled: false }, scrollBeyondLastLine: true, // good when there is multiline error message on last line scrollbar: { useShadows: true, verticalScrollbarSize: 5, vertical: "visible", horizontalScrollbarSize: 5, horizontal: "hidden" } } this.editor = monaco.editor.create(this.container, config) window.addEventListener("resize", (e) => { this.editor.layout() }) this.editor.onDidChangeModelContent((e) => { const fn = this.props.onChange if (isFunction(fn)) { const code = this.editor.getValue() this.issues.next(null) fn.apply(null, [code, this.editor, this.issues, this._forced]) } }) this.editor.addAction({ id: "executeCode", label: "Execute Code", keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter ], run: (editor) => { const fn = this.props.onExecute if (isFunction(fn)) { this.issues.next(null) fn.apply(null, [editor, this.issues]) } return null; } }) this.editor.addAction({ id: "save", label: "Save", keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S ], run: (editor) => { const fn = this.props.onSave if (isFunction(fn)) { fn() } return null; } }) this.subscribeToIssues() const action = this.editor.getAction("executeCode") action.run() } setDecorations = (issues) => { const markers = issues.map(issueToMarker) const lineDecorations = issues.map(issueToLineDecoration) this.editor.changeViewZones(changeAccessor => { this.viewZones.forEach(viewZone => changeAccessor.removeZone(viewZone)) this.viewZones = issues.map(issue => { const domNode = document.createElement("div") this.renderIssue(issue, domNode) return changeAccessor.addZone({ afterLineNumber: issue.startLineNumber, // afterColumn: 0, heightInLines: 0, domNode }) }) }) this.decorations = this.editor.deltaDecorations(this.decorations, lineDecorations) monaco.editor.setModelMarkers(this.editor.getModel(), "test", markers) } subscribeToIssues() { this.issues.pipe( scan( (acc, curr) => ((curr === null) ? [] : [...acc, curr]), [] ) ).subscribe(this.setDecorations) } renderIssue(issue, element) { ReactDOM.render(, element) } setContent(content) { this._forced = true this.editor.setValue(content) this._forced = false } render() { return (
    ) } } const Issue = (props) => (
    {props.message}
    ) const severityTable = { "error": monaco.Severity.Error, "warning": monaco.Severity.Warning, "info": monaco.Severity.Info } const issueToMarker = (issue) => ({ startLineNumber: issue.startLineNumber, startColumn: issue.startColumn, endLineNumber: issue.endLineNumber, endColumn: issue.endColumn, message: issue.message, severity: severityTable[issue.severity] }) const issueToLineDecoration = (issue) => ({ range: new monaco.Range( issue.startLineNumber, issue.startColumn, issue.startLineNumber, issue.startColumn ), options: { isWholeLine: true, className: `inlineDecoration ${issue.severity}`, glyphMarginClassName: `glyphDecoration ${issue.severity}`, glyphMarginHoverMessage: issue.message } }) ================================================ FILE: src/components/Editor/style.sass ================================================ .editor-container flex: 1 border: 1px solid lightgray border-radius: 5px overflow: hidden $backgroundColor: #f6bfbb $hoverBackgroundColor: darken($backgroundColor, 10%) .message font-family: "Fira Code" color: #791515 padding: 0 0.5em 0 0.5em font-size: smaller line-height: 24px position: absolute // overflow: hidden text-overflow: ellipsis right: 0 top: -1.8em white-space: nowrap max-width: 35% // should be set externaly to width of the remaining space on line z-index: 1 display: flex &:before content: "" width: 17px height: 17px position: absolute left: 0 background: linear-gradient(45deg, $backgroundColor, $backgroundColor, $backgroundColor, transparent, transparent) transform: rotate(45deg) transform-origin: top left border-radius: 0 0 0 3px span width: 100% flex: 1 text-overflow: ellipsis overflow: hidden margin-left: 0.1em z-index: 1 &:hover white-space: initial border-radius: 0 0 5px 5px z-index: 100 &.error background-color: $hoverBackgroundColor &:before background: $hoverBackgroundColor &.error background-color: hsla(4, 77%, 85%, 1) &.warning background-color: hsla(41, 79%, 85%, 1) $errorBackground: rgb(250, 220, 217) .inlineDecoration &.error background-color: $errorBackground &.warning background-color: hsla(55, 100%, 50%, 0.15) .glyphDecoration width: 100% !important &.error background-color: $errorBackground &:after content: "🚫" //content: "🐞" &.warning background-color: hsla(55, 100%, 50%, 0.15) &:after content: "⚠️" &:after font-size: small margin-left: 0.3em text-shadow: 0 0 0px #000000ad canvas.decorationsOverviewRuler display: none .vs .monaco-scrollable-element > .scrollbar > .slider border-radius: 10px left: -1px !important .margin-view-overlays position: relative !important .line-numbers color: #6f6f6f !important &:after content: "" position: absolute top: 0 bottom: 0 right: 11px left: 0 box-sizing: border-box border-right: 1px solid lightgray background-color: hsla(0, 0%, 50%, 0.05) pointer-events: none ================================================ FILE: src/components/Evaluator/index.js ================================================ import Parser from "../Parser" import Interpreter from "../Interpreter" class Evaluator { evaluate = async (code, env = {}, issues) => { const parsingResult = await Parser.parse(code, issues) const ast = parsingResult.result || undefined const interpretingResult = ast ? await Interpreter.interpret(ast, env, issues) : undefined const computedValues = interpretingResult ? interpretingResult.success.result || [] : {} return { code, ast, computedValues } } } export default new Evaluator ================================================ FILE: src/components/Interpreter/index.js ================================================ import { combineLatest, of, throwError } from "rxjs" import { map, tap, shareReplay, catchError, switchMap } from "rxjs/operators" import { get, isFunction, isObject, set, merge, assign, hasIn } from "lodash-es" import Symbols from "./symbols" import RootEnv from "./rootEnvironment" class Interpreter { issues = null rootEnv = RootEnv interpret = (ast, env = {}, issues) => { this.issues = issues const state = of(Object.assign(Object.create(this.rootEnv), { Self: this.rootEnv }, env)) const result = this.processToken(ast, state) return { success: { result, state } } } processToken = (token, state) => { console.log(token) if (!state) { console.error("No state to operate on!") } const fn = this.tokenActions[token.type] || this.tokenActions.__unknown__ let result try { result = fn(token, state) } catch (e) { const issue = { source: token._source || null, message: e.message, severity: e.severity } this.reportIssue(issue) console.error(e) result = null } return result } reportIssue({ source, message, severity = "error" }) { const issue = { ...source, message, severity } this.issues.next(issue) } catchIssue = (e, token, value) => { const issue = { source: token._source || null, message: e.message, severity: "error" } this.reportIssue(issue) return value || of(e) } tokenActions = { Program: (token, state) => { let stateAcc = state.pipe( tap( (state) => { console.groupCollapsed("State") console.log("Create new state from:", state) } ), map( (state) => Object.assign( Object.create(state), { [Symbols.meta]: {} } ) ), shareReplay(), tap( (state) => { console.log("New state:", (state)) console.groupEnd() } ) ) token.value.forEach(token => { const stateDelta = this.processToken(token, stateAcc) stateAcc = combineLatest(stateAcc, stateDelta).pipe( tap( ([state, stateDelta]) => { console.groupCollapsed("State merge") console.log("Going to merge state and stateDelta", state, stateDelta) } ), map( ([state, stateDelta]) => { const key = Object.keys(stateDelta)[0] let newState let meta = merge(state[Symbols.meta], stateDelta[Symbols.meta]) if (state.hasOwnProperty(key)) { newState = merge(state, stateDelta) } else { // newState = assign(state, stateDelta) newState = Object.assign(state, stateDelta) } newState[Symbols.meta] = meta return newState } ), tap( (state) => { console.log("New merged state", state) console.groupEnd() } ), shareReplay(), ) }) // Object.freeze? return stateAcc }, Assignment: (token, state) => { const path = this.processToken(token.path, state) const value = this.processToken(token.value, state) return combineLatest(path, value).pipe( tap( ([path, value]) => { console.groupCollapsed("Assignment") console.log("Creating state delta", path, value) } ), catchError( e => this.catchIssue(e, token) ), map( ([path, value]) => { const metaPath = [Symbols.meta, ...path] const obj = set({}, metaPath, { silent: token.silent, source: token._source }) set(obj, path, value) return obj } ), tap( (stateDelta) => { console.log("New state delta", stateDelta) console.groupEnd() } ) ) }, Path: (token, state) => of(token.value), FunctionApplication: (token, state) => { const fn = this.processToken(token.function, state) const arg = this.processToken(token.argument, state) return combineLatest(fn, arg).pipe( tap( ([fn, arg]) => { console.groupCollapsed("Function Application") console.log("Function", fn) console.log("Argument", arg) } ), switchMap( ([fn, arg]) => { return call(fn, arg) } ), catchError( e => this.catchIssue(e, token) ), tap( (value) => { console.log("Value", value) console.groupEnd() } ) ) }, Reference: (token, state) => { const path = this.processToken(token.value, state) return combineLatest(path, state).pipe( tap( ([path, state]) => { console.groupCollapsed("Reference") console.log("Getting a value from reference") console.log("Path", path) console.log("State", state) } ), map( ([path, state]) => { const exists = hasIn(state, path) if (!exists) { // return throwError(new Error(`No value for ${path.join(".")}`)) throw new Error(`No value for ${path.join(".")}`) } const value = get(state, path) return value } ), catchError( e => this.catchIssue(e, token, of(undefined)) ), tap( (value) => { console.log("Value", value) console.groupEnd() } ) ) }, Function: (token, state) => { return state.pipe( tap( (state) => { console.groupCollapsed("Function") console.log("State", state) console.log("Argument", token.argument) } ), map( (state) => { const fn = (arg) => { const boundEnv = Object.assign(Object.create(state), { [token.argument]: arg }) return this.processToken(token.value, of(boundEnv)) } return fn } ), tap( (fn) => { console.log("Function", fn) console.groupEnd() } ) ) }, Operation: (token, state) => { const left = this.processToken(token.left, state) const right = this.processToken(token.right, state) const fn = of(this.rootEnv[token.operator]) return combineLatest(fn, left, right).pipe( tap( ([fn, left, right]) => { console.groupCollapsed("Operation") console.log("Operator", fn) console.log("Left argument", left) console.log("Right argument", right) } ), map( ([fn, a, b]) => { return call(fn, { a, b }) } ), catchError( e => this.catchIssue(e, token) ), tap( (result) => { console.log("Result from operation:", result) console.groupEnd() } ), ) }, Tensor: (token, state) => { const value = this.processToken(token.value, state) return of(tf.tensor(value)) }, TensorLiteral: (token, state) => token.value, Object: (token, state) => { const result = this.processToken(token.value, state) return result }, String: (token, state) => of(token.value), None: (token, state) => of(undefined), __unknown__: (token, state) => { throw new Error(`Unrecognized token: ${token.type}, rest: ${token}`) } } } // TODO: when arg is {}, consider only own props // arg = isObject(arg) ? {...arg} : arg const call = (fn, arg) => { if (isFunction(fn)) { return fn(arg) } if (isObject(fn)) { const isCallable = fn.hasOwnProperty(Symbols.call) if (isCallable) { return call(fn[Symbols.call], arg) } } throw new Error(`${fn} is not callable`) } export default new Interpreter ================================================ FILE: src/components/Interpreter/modules/ActivationFunctions/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../symbols" const doc_relu = `# Rectified Linear Unit Replaces negative values with zero. \`\`\`L1 a: RectifiedLinearUnit [-1 0 1] ; [0 0 1] \`\`\` ` export default { RectifiedLinearUnit: { [Symbols.doc]: doc_relu, [Symbols.call]: arg => of(tf.relu(arg)) }, ExponentialLinearUnit: { [Symbols.doc]: `# Exponential Linear Unit`, [Symbols.call]: arg => of(tf.elu(arg)) }, ScaledExponentialLinearUnit: { [Symbols.doc]: `# Scaled Exponential Linear Unit`, [Symbols.call]: arg => of(tf.selu(arg)) }, Sigmoid: { [Symbols.doc]: `# Sigmoid`, [Symbols.call]: arg => of(tf.sigmoid(arg)) }, Softmax: { [Symbols.doc]: `# Softmax`, [Symbols.call]: arg => of(tf.softmax(arg)) }, Softplus: { [Symbols.doc]: `# Softplus`, [Symbols.call]: arg => of(tf.softplus(arg)) } } ================================================ FILE: src/components/Interpreter/modules/Arithmetics/Clip/doc.md ================================================ # Clip Clips values of the tensor to the provided minimum and/or maximum. ```L1 ::Clip clip-1: Clip ! ; 0-1 clip-2: Clip { min: 0 max: 1 } ReLU: Clip { min: 0 } test: RandomNormal [28 28] -> ReLU ``` ================================================ FILE: src/components/Interpreter/modules/Arithmetics/Clip/index.js ================================================ import * as tf from "@tensorflow/tfjs" import { of } from "rxjs" import { isObject } from "lodash-es" import Symbols from "../../../symbols" import doc from "./doc.md" const $ = (tensor) => tensor.dataSync()[0] export default { [Symbols.doc]: doc, [Symbols.call]: (arg) => { if (arg === undefined) { return of({ [Symbols.doc]: ` # Clipper Clips values to interval \`0\` – \`1\` \`\`\`L1 clipper: Clip ! a: RandomNormal [10 10] -> clipper \`\`\` `, [Symbols.call]: tensor => of(tf.maximum(tf.minimum(tensor, 1), 0)) }) } if (isObject(arg)) { const { min, max } = {...arg} return of({ [Symbols.doc]: ` # Clipper Clips values to provided \`min\` and \`max\` \`\`\`L1 clipper: Clip {${ min ? "\n min: " + $(min) : ""}${ max ? "\n max: " + $(max) : ""} } a: RandomNormal [10 10] -> clipper \`\`\` `, [Symbols.call]: tensor => { if (max && max instanceof tf.Tensor) { tensor = tf.minimum(tensor, max) } if (min && min instanceof tf.Tensor) { tensor = tf.maximum(tensor, min) } return of(tensor) } }) } }, } ================================================ FILE: src/components/Interpreter/modules/Arithmetics/index.js ================================================ import * as tf from "@tensorflow/tfjs" import { of } from "rxjs" import Clip from "./Clip" export default { Square: a => of(tf.square(a)), SquareRoot: a => of(tf.sqrt(a)), Sign: a => of(tf.sign(a)), Floor: a => of(tf.floor(a)), Ceiling: a => of(tf.ceil(a)), Round: a => of(tf.round(a)), Absolute: a => of(tf.abs(a)), Logarithm: a => of(tf.log(a)), Clip } ================================================ FILE: src/components/Interpreter/modules/Documentation/doc.md ================================================ # Syntax ## Comments ```L1 ; This is a comment ; This is a ; multiline ; comment ``` 1. Everything after a semicolon is a comment. 1. There are only single-line comments. ## Assignment ```L1 a: 0 ``` 1. Yes, a colon. It's a name–value pair, a prop(erty). 1. Names can be in `camelCase`, `PascalCase`, `python_case`, `kebab-case`, `UPPERCASE`, `lowercase` or `FüčK3d_Úp-_cäšE-ಠ_ಠ`. Nobody cares. 1. Choosing good names is **your** responsibility. ## Numbers ```L1 a: 0 b: 1 c: -2 d: -3.14 e: 1_000 ``` 1. There are no *types*. It's just a numeric value. 1. *But to be honest – 32-bit float.* [Extra](https://mlajtos.github.io/L1/latest/#eDogMC4xKygwLjIrMC4zKSwKeTogKDAuMSswLjIpKzAuMw==) 1. If your numbers are too big, too small (or they aren't numbers at all), you gotta pump those rookie numbers up. ### Tensors ```L1 scalar: 23 vector1: [1 2 3] vector2: [1,2,3] matrix1: [1 2, 3 4] matrix2: [ 1 2 3 4 ] ``` 1. Only scalars, vectors and matrices. 1. `Reshape` any tensor however you like. ## Operators ```L1 a: 1 + 2 ; 3 b: 2 - 1 ; 1 c: 1 + 2 * 2 ; 1 + 4 d: 2 * 3 / 6 ; 1 e: 3 * 2 ^ 2 + 1 ; 3 * 4 + 1 f: (3 * 2) ^ (2 + 1) ; 6^3 ``` 1. Natural order of operations. You got this! 1. Applicable to tensors of all sizes (auto broadcast). 1. There are some fancy operators. ```L1 a: [1 2 3] * 3 ; [1 2 3] × 3 b: [3 6 9] / 3 ; [3 6 9] ÷ 3 c: [1 2 3] % 2 ; matrix multiplication d: [1 2, 3 4] @ [1 2, 3 4] ; [1 2, 3 4] ⊗ [1 2, 3 4] ``` ## Function Application ```L1 a: Square 23 ; Square(23) = 23^2 b: Square [1 2 3] ; Square([1 2 3]) = [1 4 9] c: SquareRoot Square 23 ; SquareRoot(Square(23)) d: RandomNormal ! ; RandomNormal() ``` ```L1 size1: Size [1 2 3] ; size1 = 3 size2: Size [1,2,3] ; size2 = 3 size3: Size [1 2, 3 4] ; size3 = 4 shape1: Shape [1 2 3] ; shape1 = [3] shape2: Shape [1 2, 3 4] ; shape2 = [2 2] rank0: Rank 23 ; rank0 = 0 rank1: Rank [1 2 3] ; rank1 = 1 rank2: Rank [1 2, 3 4] ; rank2 = 2 min: Min [0 1 2] ; min = 0 max: Max [0 1 2] ; max = 2 mean: Mean [0 1 2] ; mean = 1 ``` 1. There is always only one argument. One is enough. 1. The argument does not have to be in parenthesis. 1. Use parenthesis if you must. 1. Use `!` to call function without an argument. ### Pipeline ```L1 a: 23 -> Square ; Square 23 b: 23 -> Square -> SquareRoot ; SquareRoot Square 23 c: [1 2, 3 4] -> Square d: [1 2, 3 4] -> Square -> SquareRoot ``` 1. Pipeline is a function application with the reversed order. 1. Pipeline can turn nested expression into a linear one. ## Objects ```L1 Obj1: { x: 1 y: 2 } Obj2: { x: 1, y: 2} ``` 1. Objects hold name–value pairs, prop(ertie)s. 1. Child object can refer to parent props directly. 1. Dot `.` operator works. 1. Shorthand notation for `abc: abc` is `::abc`. Also works for paths. ```L1 A: { x: 1 B: { y: x + 1 } } z: A.B.y ; z: 2 ``` ```L1 y: { x: 2 value: x * 3 }.value ``` ```L1 A: { i: 23 B: { j: 47 } C: { ::i ; i: i ::B.j ; j: B.j } } ``` ## Functions ```L1 Fn: x => x^2 a: Fn 3 ``` 1. There is only one argument. 1. Higher-order functions are okay. ```L1 Fn: x => { linear: x quadratic: x^2 cubic: x^3 } A: Fn 3 ; A: { ; linear: 3 ; quadratic: 9 ; cubic: 27 ; } ``` ```L1 Fn: x => y => x + y ; higher-order function a: (Fn 2) 3 ; JS: Fn(2)(3) b: 3 -> (2 -> Fn) c: 3 -> (Fn 2) d: (2 -> Fn) 3 ``` ```L1 Fn: A => { z: A.x + A.y value: z^2 }.value a: Fn { x: 1 y: 2 } ``` ```L1 Flip: S => { a: S.b b: S.a } mu: { a: 0, b: 1 } -> Flip -> Flip -> Flip ``` ## IIFE ```L1 iife1: 22 -> a => a + 1 iife2: (a => a + 1) 22 ``` ## Functional Objects 1. Object can be used as a function. 1. Good for many things, mostly encapsulation. 1. Can have documentation attached. ```L1 fn: { #call: a => a + 23 #doc: "Adds 23 and the provided *value*" } test: fn 24 ``` # Extra info ### Self Top-level prop `Self` contains everything that is available by default, something like "standard library". ```L1 :: Self ``` ### Silent assignment ```L1 _a: 23 _b: 24 c: a + b ``` 1. Use underscore `_` in front of an assignment, to silence it. 1. (Therefore, no names with leading `_`, yay!) 1. Values still exist and can be used – they are just not displayed. ### None Expressions `()` and `!` (and top-level prop `None`) have value that is equivalent of `None` in Python or `undefined` in Javascript. It is useful when calling a function that does not need an argument. ```L1 a: () b: ! c: None ``` ### Booleans There are top-level props called `False` and `True`. There is no use for them yet. ### Strings There is a rudimentary support for strings. However, no concatenation, no interpolation, no manipulation. They are necessary for documentation right now. ### Symbols Following example shows two assignments. First is a normal prop – string as a key, second is a symbol prop – symbol as a key: ```L1 mu: 2 #mu: 2 ``` Symbol props are not displayed (silenced by default), and have a special purpose. For example, `#call` is used when object is used as a function in function application. `#doc` holds a Markdown documentation for the object. There is also a `#meta` prop, that is used internally to do various stuff: ```L1 mu: { a: 23 _b: 47 } meta: mu.#meta ``` Symbol props can store any values and can be accessed in the same way as a normal props. ### Keyboard shortcuts * force-evaluate code – `Ctrl+Enter` or `Cmd-Return` * create sharable URL – `Ctrl+S` or `Cmd-S` ================================================ FILE: src/components/Interpreter/modules/Documentation/index.js ================================================ import doc from "./doc.md" export default { [Symbol.for("doc")]: doc } ================================================ FILE: src/components/Interpreter/modules/Generators/Eye/doc.md ================================================ # Eye Returns an identity matrix of size `n`. ```L1 ::Eye a: Eye ! ; 1 c: Eye 2 ; [1 0, 0 1] d: Eye 10 ``` ================================================ FILE: src/components/Interpreter/modules/Generators/Eye/index.js ================================================ import * as tf from "@tensorflow/tfjs" import { of } from "rxjs" import doc from "./doc.md" const $ = (tensor) => tensor.dataSync()[0] export default { [Symbol.for("doc")]: doc, [Symbol.for("call")]: arg => { if (arg === undefined) { return of(tf.scalar(1)) } return of(tf.eye($(arg))) } } ================================================ FILE: src/components/Interpreter/modules/Generators/LinearSpace/doc.md ================================================ # LinearSpace Returns a vector of length `count` with values from `start` to `stop`. ```L1 ::LinearSpace a: LinearSpace ! ; [0 1] b: LinearSpace { start: 0 stop: 1 count: 2 } shape: Shape b ; shape = [2] = count min: Min b ; min = 0 = start max: Max b ; max = 1 = stop c: LinearSpace { count: 100 } ``` ================================================ FILE: src/components/Interpreter/modules/Generators/LinearSpace/index.js ================================================ import * as tf from "@tensorflow/tfjs" import { of } from "rxjs" import doc from "./doc.md" const $ = (tensor) => tensor.dataSync()[0] export default { [Symbol.for("doc")]: doc, [Symbol.for("call")]: arg => { if (arg === undefined) { return of(tf.linspace(0, 1, 2)) } const start = arg.hasOwnProperty("start") ? $(arg.start) : 0 const stop = arg.hasOwnProperty("stop") ? $(arg.stop) : 1 const count = arg.hasOwnProperty("count") ? $(arg.count) : 2 return of(tf.linspace(start, stop, count)) } } ================================================ FILE: src/components/Interpreter/modules/Generators/Ones/doc.md ================================================ # Ones Returns a tensor filled with 1 everywhere. ```L1 ::Ones a: Ones ! ; a = Ones [] b: Ones [2 2] ; b = [1 1, 1 1] ``` ================================================ FILE: src/components/Interpreter/modules/Generators/Ones/index.js ================================================ import * as tf from "@tensorflow/tfjs" import { of } from "rxjs" import doc from "./doc.md" const $ = (tensor) => tensor.dataSync() export default { [Symbol.for("doc")]: doc, [Symbol.for("call")]: shape => { if (shape === undefined) { return of(tf.ones([])) } return of(tf.ones($(shape))) } } ================================================ FILE: src/components/Interpreter/modules/Generators/Zeros/doc.md ================================================ # Zeros Returns a tensor filled with 0 everywhere. ```L1 ::Zeros a: Zeros ! ; a = Zeros [] = 0 b: Zeros [2 2] ; b = [0 0, 0 0] ``` ================================================ FILE: src/components/Interpreter/modules/Generators/Zeros/index.js ================================================ import * as tf from "@tensorflow/tfjs" import { of } from "rxjs" import doc from "./doc.md" const $ = (tensor) => tensor.dataSync() export default { [Symbol.for("doc")]: doc, [Symbol.for("call")]: shape => { if (shape === undefined) { return of(tf.zeros([])) } return of(tf.zeros($(shape))) } } ================================================ FILE: src/components/Interpreter/modules/Generators/index.js ================================================ import LinearSpace from "./LinearSpace" import Ones from "./Ones" import Zeros from "./Zeros" import Eye from "./Eye" export default { Ones, Zeros, Eye, LinearSpace, } ================================================ FILE: src/components/Interpreter/modules/Meta/Expand/doc.md ================================================ # Expand Expand the shape of a tensor. Insert a new axis that will appear at the axis position in the expanded tensor shape. ```L1 ::Expand a: [1 2 3 4] shape-a: Shape a ; shape-a = [4] b: a -> Expand 0 shape-b: Shape b ; shape-b = [1 4] c: a -> Expand 1 shape-c: Shape c ; shape-b = [4 1] expander-0: Expand 0 ``` ================================================ FILE: src/components/Interpreter/modules/Meta/Expand/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (axis) => { const axis_native = axis.dataSync()[0] return of({ [Symbols.call]: (tensor) => of(tf.expandDims(tensor, axis_native)), [Symbols.doc]: `# Expander Expands axis ${axis_native} of provided tensor \`\`\`L1 expander: Expand ${axis_native} a: RandomNormal [20 20] -> expander \`\`\` ` }) }, [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Meta/Rank/doc.md ================================================ # Rank Rank returns the rank of the provided tensor ```L1 ::Rank rank-0: Rank 1 ; rank-0 = 0 rank-1: Rank [1 2 3] ; rank-1 = 1 rank-2: Rank [1 2, 3 4] ; rank-2 = 2 rank-3: Rank RankUp [1 2, 3 4] ; rank-3 = 3 ``` Rank can be expressed as the size of the shape of a tensor: ```L1 Rank: a => Size Shape a ``` ================================================ FILE: src/components/Interpreter/modules/Meta/Rank/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (tensor) => of(tf.tensor(tensor.rank)), [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Meta/Reshape/doc.md ================================================ # Reshape Returns a function that reshapes a tensor to specified shape. ```L1 ::Reshape a: [1 2 3 4] shape1: Shape a ; shape = [4] b: a -> Reshape [2 2] shape2: Shape b ; shape = [2 2] c: (Reshape [4 1]) a reshaper: Reshape [10 10] ``` ================================================ FILE: src/components/Interpreter/modules/Meta/Reshape/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (shape) => { const shape_native = shape.dataSync() // const size = shape.prod() const size = shape_native.reduce((a, c) => a * c) const shape_string = "[" + shape_native.join(" ") + "]" return of({ [Symbols.call]: (tensor) => of(tf.reshape(tensor, shape_native)), [Symbols.doc]: `# Reshaper Reshapes tensor to ${shape_string} \`\`\`L1 reshaper: Reshape ${shape_string} a: RandomNormal ${size} -> reshaper \`\`\` ` }) }, [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Meta/Reverse/doc.md ================================================ # Reverse Reverses the tensor. ```L1 ::Reverse a: Reverse [1 2 3] b: Reverse [1 2, 3 4] ``` ================================================ FILE: src/components/Interpreter/modules/Meta/Reverse/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (tensor) => of(tf.reverse(tensor)), [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Meta/Shape/doc.md ================================================ # Shape Shape returns shape of the provided tensor. ```L1 shape-1: Shape 1 ; shape = [] shape-2: Shape [1] ; shape = [1] shape-3: Shape [1 2 3] ; shape = [3] shape-4: Shape [1 2, 3 4] ; shape = [2 2] ``` ================================================ FILE: src/components/Interpreter/modules/Meta/Shape/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (tensor) => of(tf.tensor(tensor.shape)), [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Meta/Size/doc.md ================================================ # Size Size returns size (number of elements) of the provided tensor. ```L1 size-1: Size 1 ; size = 1 size-2: Size [1] ; size = 1 size-3: Size [1 2 3] ; size = 3 size-4: Size [1 2, 3 4] ; size = 4 ``` ================================================ FILE: src/components/Interpreter/modules/Meta/Size/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (tensor) => of(tf.tensor(tensor.size)), [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Meta/Transpose/doc.md ================================================ # Transpose Transposes the tensor. ```L1 ::Transpose _test: x => { original: x transposed: Transpose x } a: test [1,2,3] b: test [ 1 2 3 4 5 6 7 8 9 ] c: test [1 2 3, 4 5 6] ``` ================================================ FILE: src/components/Interpreter/modules/Meta/Transpose/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (tensor) => of(tf.transpose(tensor)), [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Meta/index.js ================================================ // Shape, Size, Rank should be differentiable for AutoML // No idea what that means :D import Shape from "./Shape" import Size from "./Size" import Rank from "./Rank" import Reshape from "./Reshape" import Expand from "./Expand" import Transpose from "./Transpose" import Reverse from "./Reverse" export default { Shape, Size, Rank, Reshape, Expand, Transpose, Reverse } ================================================ FILE: src/components/Interpreter/modules/Mouse.js ================================================ import { fromEvent } from "rxjs" import { map } from "rxjs/operators" import Symbols from "../symbols" export default { [Symbols.doc]: ` # Mouse Provides mouse coordinates (\`x\` and \`y\`) inside the window. \`\`\`L1 x: Mouse.x y: Mouse.y \`\`\` `, x: fromEvent(window, "mousemove").pipe(map(e => tf.scalar(e.x))), y: fromEvent(window, "mousemove").pipe(map(e => tf.scalar(e.y))), } ================================================ FILE: src/components/Interpreter/modules/Random/Normal/doc.md ================================================ # RandomNormal Returns a tensor with values sampled from a normal distribution. ```L1 ::RandomNormal randomScalar: RandomNormal! randomVector1: RandomNormal [10] randomVector2: [10] -> RandomNormal randomMatrix: [10 10] -> RandomNormal a: RandomNormal { shape: [28 28] } b: RandomNormal { shape: [28 28] mean: 0 stdDev: 1 } ``` ================================================ FILE: src/components/Interpreter/modules/Random/Normal/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import { isObject } from "lodash-es" import Symbols from "../../../symbols" import doc from "./doc.md" const $ = (tensor) => Array.from(tensor.dataSync()) export default { RandomNormal: { [Symbols.doc]: doc, [Symbols.call]: arg => { let shape = tf.scalar(1) let mean = tf.scalar(0) let stdDev = tf.scalar(1) if (arg === undefined) { return of(tf.scalar($(tf.randomNormal($(shape), $(mean)[0], $(stdDev)[0]))[0])) } if (arg instanceof tf.Tensor) { shape = arg return of(tf.randomNormal($(shape), $(mean)[0], $(stdDev)[0])) } if (!isObject(arg)) { throw Error("RandomNormal needs tensor or object") } if (arg.hasOwnProperty("shape")) { shape = arg.shape } else { throw Error("RandomNormal { shape: ? }") } if (arg.hasOwnProperty("mean")) { mean = arg.mean } if (arg.hasOwnProperty("stdDev")) { stdDev = arg.stdDev } return of(tf.randomNormal($(shape), $(mean)[0], $(stdDev)[0])) } } } ================================================ FILE: src/components/Interpreter/modules/Random/Uniform/doc.md ================================================ # RandomUniform Returns a tensor with values sampled from a uniform distribution. ```L1 ::RandomUniform randomScalar: RandomUniform! randomVector1: RandomUniform [10] randomVector2: [10] -> RandomUniform randomMatrix: [10 10] -> RandomUniform a: RandomUniform { shape: [28 28] } b: RandomUniform { shape: [28 28] min: 0 max: 1 } ``` ================================================ FILE: src/components/Interpreter/modules/Random/Uniform/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import { isObject } from "lodash-es" import Symbols from "../../../symbols" import doc from "./doc.md" const $ = (tensor) => Array.from(tensor.dataSync()) export default { RandomUniform: { [Symbols.doc]: doc, [Symbols.call]: arg => { let shape = tf.scalar(1) let min = tf.scalar(0) let max = tf.scalar(1) if (arg === undefined) { return of(tf.scalar($(tf.randomUniform($(shape), $(min)[0], $(max)[0]))[0])) } if (arg instanceof tf.Tensor) { shape = arg return of(tf.randomUniform($(shape), $(min)[0], $(max)[0])) } if (!isObject(arg)) { throw Error("RandomUniform needs tensor or object") } if (arg.hasOwnProperty("shape")) { shape = arg.shape } else { throw Error("RandomUniform { shape: ? }") } if (arg.hasOwnProperty("min")) { min = arg.min } if (arg.hasOwnProperty("max")) { max = arg.max } return of(tf.randomUniform($(shape), $(min)[0], $(max)[0])) } } } ================================================ FILE: src/components/Interpreter/modules/Random/index.js ================================================ import Normal from "./Normal" import Uniform from "./Uniform" export default { ...Normal, ...Uniform } ================================================ FILE: src/components/Interpreter/modules/Reducers/Max/doc.md ================================================ # Max Max returns the maximum of the provided tensor ```L1 ::Max max-1: Max 1 ; max = 1 max-2: Max [1 2 3] ; max = 3 ``` ================================================ FILE: src/components/Interpreter/modules/Reducers/Max/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (tensor) => of(tf.max(tensor)), [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Reducers/Mean/doc.md ================================================ # Mean Returns the mean of the provided tensor ```L1 ::Mean mean-1: Mean 1 ; mean = 1 mean-2: Mean [1 2 3] ; mean = 2 mean-3: Mean [1 2] ; mean = 1.5 ``` ================================================ FILE: src/components/Interpreter/modules/Reducers/Mean/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (tensor) => of(tf.mean(tensor)), [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Reducers/Min/doc.md ================================================ # Min Min returns the minimum of the provided tensor ```L1 ::Min min-1: Min 1 ; min = 1 min-2: Min [1 2 3] ; min = 1 ``` ================================================ FILE: src/components/Interpreter/modules/Reducers/Min/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (tensor) => of(tf.min(tensor)), [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Reducers/Product/doc.md ================================================ # Product Product returns the product of the provided tensor. **Note:** *TensorFlow.js does not support product (tf.prod) at the moment.* ```L1 ::Product prod-1: Product 1 ; prod-1 = 1 prod-2: Product [1 2 3] ; prod-2 = 6 prod-3: *[1 2 3] ; prod-3 = 6 prod-4: *[1 2, 3 4] ; prod-4 = 24 ``` ================================================ FILE: src/components/Interpreter/modules/Reducers/Product/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (tensor) => { if (tf.prod) { return of(tf.prod(tensor)) } else { return of(new Error("TensorFlow.js does not support tf.prod().")) } }, [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Reducers/Sum/doc.md ================================================ # Sum Sum returns the sum of the provided tensor ```L1 ::Sum sum-1: Sum 1 ; sum-1 = 1 sum-2: Sum [1 2 3] ; sum-2 = 6 sum-3: +[1 2 3] ; sum-3 = 6 sum-4: +[1 2, 3 4] ; sum-4 = 10 ``` ================================================ FILE: src/components/Interpreter/modules/Reducers/Sum/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../../symbols" import doc from "./doc.md" export default { [Symbols.call]: (tensor) => of(tf.sum(tensor)), [Symbols.doc]: doc } ================================================ FILE: src/components/Interpreter/modules/Reducers/index.js ================================================ import Min from "./Min" import Max from "./Max" import Mean from "./Mean" import Sum from "./Sum" import Product from "./Product" export default { Min, Max, Mean, Sum, Product } ================================================ FILE: src/components/Interpreter/modules/TensorOperators/index.js ================================================ import * as tf from "@tensorflow/tfjs" const binarize = (fn) => (({ a, b }) => fn(a, b)) export default { "+": ({a, b}) => { if (a === undefined) { return tf.sum(b) } return tf.add(a, b) }, "-": ({a, b}) => { if (a === undefined) { return tf.neg(b) } return tf.sub(a, b) }, "*": ({a, b}) => { if (a === undefined) { if (!tf.prod) { return new Error("TensorFlow.js does not support tf.prod().") } return tf.prod(b) } return tf.mul(a, b) }, "×": ({a, b}) => { if (a === undefined) { if (!tf.prod) { return new Error("TensorFlow.js does not support tf.prod().") } return tf.prod(b) } return tf.mul(a, b) }, "/": ({a, b}) => { if (a === undefined) { return tf.reciprocal(b) } return tf.div(a, b) }, "÷": ({a, b}) => { if (a === undefined) { return tf.reciprocal(b) } return tf.div(a, b) }, "^": binarize(tf.pow), "%": binarize(tf.mod), "@": binarize(tf.matMul), "⊗": binarize(tf.matMul), } ================================================ FILE: src/components/Interpreter/modules/Trigonometry/index.js ================================================ import * as tf from "@tensorflow/tfjs-core" import { of } from "rxjs" import Symbols from "../../symbols" export default { Sine: a => of(tf.sin(a)), Cosine: a => of(tf.cos(a)), Tangent: a => of(tf.tan(a)), ArcusSine: a => of(tf.asin(a)), ArcusCosine: a => of(tf.acos(a)), ArcusTangent: a => of(tf.atan(a)), } ================================================ FILE: src/components/Interpreter/rootEnvironment.js ================================================ import * as tf from "@tensorflow/tfjs-core" window.tf = tf import Symbols from "./symbols" import Mouse from "./modules/Mouse" import Documentation from "./modules/Documentation" import Random from "./modules/Random" import ActivationFunctions from "./modules/ActivationFunctions" import Trigonometry from "./modules/Trigonometry" import TensorOperators from "./modules/TensorOperators" import Arithmetics from "./modules/Arithmetics" import Generators from "./modules/Generators" import Reducers from "./modules/Reducers" import Meta from "./modules/Meta" export default { ...Documentation, Empty: {}, False: false, True: true, None: undefined, ...Meta, ...Reducers, ...TensorOperators, ...Generators, ...Random, ...ActivationFunctions, ...Trigonometry, ...Arithmetics, ".": ({a, b}) => a[b], Mouse } ================================================ FILE: src/components/Interpreter/symbols.js ================================================ export const toSymbol = (tag) => Symbol.for(tag) const Symbols = { meta: toSymbol("meta"), doc: toSymbol("doc"), call: toSymbol("call"), // value: toSymbol("value"), true: toSymbol("true"), false: toSymbol("false") } export default Symbols ================================================ FILE: src/components/Interpreter_OLD/index.js ================================================ import runtimeEnvironment from "./runtimeEnvironment" import * as tf from "@tensorflow/tfjs-core" import { isPlainObject, isFunction, has, hasIn, set, get, merge, isObject } from "lodash-es" import { Subject, Observable, combineLatest, of } from "rxjs" import { map } from "rxjs/operators" import { operatorToFunction } from "./operators" import { SYMBOLS } from "./symbols" import { forEach_async, get_async, combineLatestObj } from "./utils" class Interpreter { issues = new Subject() tokenActions = { Program: async (token, state) => { // tf.tidy somewhere here let stateAcc = Object.create(state) const assignments = await forEach_async(token.value, async (assignment) => { // is it possible to do merging without mutation? const stateDelta = await this.processToken(assignment, stateAcc) stateAcc = merge(stateAcc, stateDelta) const _m = SYMBOLS.meta stateAcc[_m] = merge({}, stateAcc[_m], stateDelta[_m]) }) return stateAcc }, // ripe for refactoring Assignment: async (token, state) => { const path = await this.processToken(token.path, state) const value = this.processToken(token.value, state) // do not await value const silent = token.silent || false const isVariable = token.variable || false const exists = has(state, path) const baseValue = { [SYMBOLS.meta]: { [path]: { silent, source: token._source } } } if (exists) { console.log(`${path.join(".")} exists in`, state) const oldValue = await get(state, path) const valueIsVariable = oldValue instanceof tf.Variable if (valueIsVariable) { const fn = getFunction("Assign") const newValue = call(fn, { tensor: oldValue, value }) return set(baseValue, path, newValue) } else { throw Error(`Only variables can be reassigned. Use $${path.join(".")}`) } } else { if (isVariable) { const fn = getFunction("Variable") const newValue = call(fn, value) return set(baseValue, path, newValue) } else { // when checking value of ref // if flag or same as provided value // use state.__proto__ instead for lookup const mu = set(baseValue, path, value) return mu } } throw Error(`This will never happen.`) }, Reference: async (token, state) => { const path = await this.processToken(token.value, state) const value = await get_async(state, path, null) // console.log("Reference",path, value, state) if (!value) { console.log(Object.keys(state).join(", ")) throw new Error(`No value for "${path.join(".")}".`) } return value }, Path: async (token, state) => { return token.value }, Function: async (token, state) => { const fn = async (arg) => { const boundEnv = Object.create(Object.assign(Object.create(state), { [token.argument]: arg })) return await this.processToken(token.value, boundEnv) } return fn }, FunctionApplication: async (token, state) => { // // when there is no argument for function === only one value (reference) // this is a wart at the grammar level if (!token.argument) { let value = await this.processToken(token.function, state) if (!(value instanceof Observable)) { value = of(value) } return value } // let fn = await this.processToken(token.function, state) let value = await this.processToken(token.argument, state) if (!(fn instanceof Observable)) { fn = of(fn) } if (!(value instanceof Observable)) { value = of(value) } const result = combineLatest(fn, value).pipe(map(async (v) => { return await call(await v[0], await v[1]) })) console.log(result) return result // const result = value.pipe(map(async (v) => await call(fn, await v))) // return call(fn, value) }, BinaryOperation: async (token, state) => { let a = await this.processToken(token.left, state) let b = await this.processToken(token.right, state) let fn = operatorToFunction(token.operator, 2) if (!(fn instanceof Observable)) { fn = of(fn) } if (!(a instanceof Observable)) { a = of(a) } if (!(b instanceof Observable)) { b = of(b) } console.log(fn, a, b) const observable = combineLatest(fn, a, b).pipe(map(async (v) => await call(v[0], { a: await v[1], b: await v[2] }))) return observable // return call(fn, { a, b }) }, UnaryOperation: async (token, state) => { let value = await this.processToken(token.value, state) let fn = operatorToFunction(token.operator, 1) if (!(value instanceof Observable)) { value = of(value) } const observable = value.pipe(map(async (v) => await call(fn, await v))) return observable // return call(fn, value) }, Tensor: async (token, state) => { const value = await this.processToken(token.value, state) const fn = getFunction("Tensor") return call(fn, value) }, TensorLiteral: async (token, state) => { return token.value }, Object: async (token, state) => { const result = await this.processToken(token.value, Object.create(state)) return result }, __unknown__: async (token, state) => { console.log(token) return `Unrecognized token: ${token.type}, rest: ${token}` } } interpret = async (ast, env = {}, issues) => { const state = Object.assign(Object.create(runtimeEnvironment), env) this.issues = issues const result = await this.processToken(ast, state) return { success: { result, state } } } reportIssue({ source, message, severity = "error" }) { const issue = { ...source, message, severity } this.issues.next(issue) } processToken = async (token, state) => { if (!state) { console.error("No state to operate on!") } // console.log(token) const fn = this.tokenActions[token.type] || this.tokenActions.__unknown__ let result try { result = await fn(token, state) } catch (e) { if (token._source) { const issue = { // [SYMBOLS.meta]: {}, source: token._source, message: e.message, severity: e.severity } this.reportIssue(issue) console.error(e) throw new Error(e.message) // return new Error(e.message) } else { console.error(e) } result = null } return result } } // This is basically a reference with top-down name resolution. export const getFunction = (path, state = runtimeEnvironment) => { const passThrough = arg => arg const fn = get(state, path, null) if (!fn) { throw ({ message: `Function "${name}"?`, severity: "error" }) } return fn || passThrough } /* **TODO**: - memoize maybe? - fn should consider only ownProps of arg - how to inject dynamic scope? */ const call = async (fn, arg) => { console.log("call", fn, arg) fn = await fn arg = await arg if (isFunction(fn)) { return fn(arg) } if (isObject(fn)) { const isCallable = fn.hasOwnProperty(SYMBOLS.call) if (isCallable) { return call(fn[SYMBOLS.call], arg) } } console.log(fn) throw new Error(`${fn} is not callable.`) } export default new Interpreter ================================================ FILE: src/components/Interpreter_OLD/operators.js ================================================ import { getFunction } from "./index" export const OPERATORS = { "1": { "'": "ConvertToNative", "-": "Negative", "/": "Reciprocal" }, "2": { "+": "Add", "-": "Subtract", "*": "Multiply", "×": "Multiply", "/": "Divide", "÷": "Divide", "^": "Power", "%": "Modulus", "@": "MatrixMultiply", "⊗": "MatrixMultiply", ".": "PropertyAccess" // TODO: strict versions should be ++, --, **, //, etc. (if they are needed) } } export const operatorToFunction = (operator, arity) => { if (!arity) { console.error(`Missing "arity" argument for operator "${operator}".`) } const functionName = OPERATORS[arity][operator] if (!functionName) { console.error(`Operator "${operator}" does not have an associated function.`) } const fn = getFunction(functionName) return fn } ================================================ FILE: src/components/Interpreter_OLD/runtimeEnvironment.js ================================================ import * as tf from "@tensorflow/tfjs-core" window.tf = tf //import * as mnist from "mnist" import { flow, get, hasIn } from "lodash-es" import { Observable, fromEvent, of } from "rxjs" import { map, combineLatest } from "rxjs/operators" import { combineLatestObj } from "./utils" import { SYMBOLS } from "./symbols" import doc from "../../../README.md" class Variable extends tf.Variable { _mutationObservers = [] assign(newValue) { super.assign(newValue) this.notify() } subscribe(fn) { this._mutationObservers.push(fn) } unsubscribe(fn) { this._mutationObservers = this._mutationObservers.filter(mo => mo !== fn) } notify() { this._mutationObservers.forEach(mo => mo.call()) } } class Scope { [SYMBOLS.meta] = {} [SYMBOLS.doc] = doc constructor(config) { } PropertyAccess = ({ a, b }) => { const found = hasIn(a, b) if (!found) { throw new Error(`No such thing.`) } return get(a, b) } Tensor = tf.tensor Variable = async (tensor) => new Variable(await tensor) Assign = async ({ tensor, value }) => { tensor = await tensor tensor.assign(await value) return tensor } Shape = (tensor) => tf.tensor(tensor.shape) Rank = (tensor) => tf.scalar(tensor.rank) Size = (tensor) => tf.scalar(tensor.size) L1 = Object.assign({ [SYMBOLS.call]: async (args) => { return this }, [SYMBOLS.doc]: doc, mu: tf.scalar(23) }, Object.create(Scope)) Mouse = { [SYMBOLS.doc]: ` Provides mouse coordinates (\`x\` and \`y\`) inside the window. \`\`\` x: Mouse.x y: Mouse.y pressed: Mouse.pressed \`\`\` `, x: fromEvent(window, "mousemove").pipe(map(e => tf.scalar(e.x))), y: fromEvent(window, "mousemove").pipe(map(e => tf.scalar(e.y))), } Mean = async (args) => { if (!args) { // Mean ? return this.Mean } if (args.axis) { const axis = await args.axis const axis_n = await this.ConvertToNative(axis) if (args.tensor) { const tensor = await args.tensor return tf.mean(tensor, axis_n) } return async (tensor) => this.Mean({ tensor, axis }) } } Sum = async (args) => { if (!args) { // Sum ? return this.Sum } if (args.axis) { const axis = await args.axis const axis_n = await this.ConvertToNative(axis) if (args.tensor) { const tensor = await args.tensor return tf.sum(tensor, axis_n) } return async (tensor) => this.Sum({ tensor, axis }) } } Min = async ({ tensor, axis = tf.scalar(0) }) => { axis = await this.ConvertToNative(await axis) return tf.min(await tensor, await axis) } /* Reshape { input: tensor, shape: [100 100] } # ukecané Reshape {shape: [100 100]} tensor # Re-shape-shape Reshape [100 100] tensor # hm tensor -> Reshape [100 100] # ok tensor -> Reshape { shape: [100 100] } # ukecané tensor.reshape([100, 100]) # orig */ // Shape shifters Reshape = async ({ tensor, shape }) => { shape = tf.tensor([tensor.shape]) shape = await this.ConvertToNative(await shape) return tf.reshape(await tensor, await shape) } Squeeze = async ({ tensor, axis }) => { axis = await this.ConvertToNative(await axis) return tf.squeeze(await tensor, await axis) } SqueezeAll = async (tensor) => { return tf.squeeze(await tensor) } Transpose = async (tensor) => { return tf.transpose(await tensor) } ExpandDimension = async (args) => { console.log("Expand dimension:", args) if (!args) { // ExpandDimension ? return this.ExpandDimension } if (args.axis) { const axis = await args.axis const axis_n = await this.ConvertToNative(axis) if (args.tensor) { const tensor = await args.tensor return tf.expandDims(tensor, axis_n) } return async (tensor) => this.ExpandDimension({ tensor, axis }) } throw new Error(`Expected axis parameter.`) } // ExpandDimension = async ({ tensor, axis = tf.scalar(0) }) => { // const axis_n = await this.ConvertToNative(await axis) // if (tensor) { // tensor = await tensor // return tf.expandDims(tensor, axis_n) // } // //return async (tensor) => tf.expandDims(tensor, axis) // return async (tensor) => this.ExpandDimension({ tensor, axis }) // } RankUp = async (tensor) => { return tf.expandDims(await tensor, 0) } ResizeBilinear = async ({ tensor, shape }) => { shape = shape || this.Shape(await tensor) shape = await this.ConvertToNative(await shape) return tf.image.resizeBilinear(await tensor, await shape) } MaxPool = async ({ tensor, filterSize = tf.scalar(1), strides = tf.scalar(1) }) => { filterSize = await this.ConvertToNative(await filterSize) strides = await this.ConvertToNative(strides) return tf.maxPool(await tensor, await filterSize, await strides, "same") } Convolution2D = async ({ tensor, filter, strides = tf.scalar(1) }) => { strides = this.ConvertToNative(await strides) return tf.conv2d(await tensor, await filter, await strides, "same") } Tile = async ({ tensor, reps }) => { reps = await this.ConvertToNative(await reps) return tf.tile(await tensor, await reps) } Slice = async ({ tensor, begin, size }) => { begin = this.ConvertToNative(await begin) size = this.ConvertToNative(await size) return tf.slice(await tensor, await begin, await size) } // Arithmetics Negative = tf.neg Add = ({ a, b }) => tf.add(a, b) Subtract = ({ a, b }) => tf.sub(a, b) // Multiply = ({ a, b }) => tf.mul(a, b) Multiply = ({ a, b }) => combineLatest(a, b).pipe(map(([a, b]) => tf.mul(a, b))) Divide = ({ a, b }) => tf.div(a, b) Modulus = ({ a, b }) => tf.mod(a, b) Power = ({ a, b }) => tf.pow(a, b) MatrixMultiply = ({ a, b }) => tf.matMul(a, b) Square = tf.square SquareRoot = tf.sqrt Reciprocal = tf.reciprocal Sign = tf.sign Floor = tf.floor Ceiling = tf.ceil // Round = async (tensor) => tf.round(await tensor) Round = a => { console.log(a) return a.pipe(map(a => tf.round(a))) } Absolute = tf.abs Logarithm = tf.log // Trigonometry Sine = tf.sin Cosine = tf.cos Tangent = tf.tan ArcusSine = tf.asin ArcusCosine = tf.acos ArcusTangent = tf.atan // Activation Functions ExponentialLinearUnit = tf.elu RectifiedLinearUnit = tf.relu Sigmoid = tf.sigmoid Softmax = tf.softmax Softplus = tf.softplus /* mu: Round (Mouse.x / 1440) x: mu * RandomNormal { shape: [100 100] } */ // Generators RandomNormal = async ({ shape = of(tf.tensor([1])), mean = of(tf.scalar(0)), stdDev = of(tf.scalar(1)) }) => { return combineLatestObj({ shape, mean, stdDev }).pipe(map( async ({ shape, mean, stdDev }) => { shape = await this.ConvertToNative(args.shape) mean = await this.ConvertToNative(mean) stdDev = await this.ConvertToNative(stdDev) return tf.randomNormal(shape, mean, stdDev) } )) } RandomUniform = ({ shape, min = tf.scalar(0), max = tf.scalar(1), dtype }) => { shape = this.ConvertToNative(shape) min = this.ConvertToNative(min) max = this.ConvertToNative(max) return tf.randomUniform(shape, min, max, dtype) } LinearSpace = ({ start = tf.scalar(0), stop = tf.scalar(1), num = tf.scalar(10) }) => { start = this.ConvertToNative(start) stop = this.ConvertToNative(stop) num = this.ConvertToNative(num) return tf.linspace(start, stop, num) } Iota = async (value) => { value = await this.ConvertToNative(value) return tf.linspace(1, value, value) } Ones = (shape) => { shape = this.ConvertToNative(shape) return tf.ones(shape) } Zeros = (shape) => { shape = this.ConvertToNative(shape) return tf.zeros(shape) } GetDigit = (classes = tf.scalar(0)) => { classes = this.ConvertToNative(classes) // return tf.tensor(mnist[classes].get()).reshape([28, 28]) } Gradient = (f) => { return tf.grad(f) } StochasticGradientDescent = async ({ learningRate = tf.scalar(1), maxIterations = tf.scalar(10), maxTime = tf.scalar(1000) }) => { learningRate = await this.ConvertToNative(await learningRate) maxIterations = await this.ConvertToNative(await maxIterations) maxTime = await this.ConvertToNative(await maxTime) const optimizer = tf.train.sgd(learningRate) const minimize = optimizer.minimize.bind(optimizer) const optimize = async (lossFn) => { lossFn = await lossFn const losses = [] const mu = new Variable(tf.tensor1d([])) const t0 = performance.now() for (let i = 0; i < maxIterations; i++) { const u0 = performance.now() const loss = await lossFn.call() const cost = minimize((() => loss), true) losses.push(await this.RankUp(await loss)) //mu.assign(tf.concat(await Promise.all(losses))) const u1 = performance.now() const timePerIteration = u1 - u0 const totalTime = u1 - t0 //console.log("timePerIteration", timePerIteration) //console.log("totalTime", totalTime) if (totalTime > maxTime) { break; } await tf.nextFrame() } //return mu return tf.concat(await Promise.all(losses)) } return optimize } Flow = async ({ fn = async a => a, count = tf.scalar(1) }) => { fn = await fn count = await this.ConvertToNative(count) return flow(Array.from({ length: count }, (v, i) => fn)) } ConvertToNative = async (tensor) => { tensor = await tensor const isTensor = (tensor instanceof tf.Tensor) if (!isTensor) { throw new Error(`Only tensors can be converted to native type.`) console.log(tensor) return } const data = await tensor.data() if (tensor.rank === 0 && tensor.size === 1) { return data[0] } return Array.from(data) } } // const registerMaxPool = () => { // return registerFunction({ // description = { // config: { // tensor: "The input tensor, of rank 4 or rank 3 of shape [batch, height, width, inChannels]. If rank 3, batch of 1 is assumed.", // filterSize: "The filter size, a tuple [filterHeight, filterWidth]", // stride: "The strides of the pooling: [strideHeight, strideWidth]" // } // }, // implementation = tf.maxPool(config.tensor, config.filterSize, config.strides, "same") // }) // } const library = new Scope() export default library ================================================ FILE: src/components/Interpreter_OLD/symbols.js ================================================ export const SYMBOLS = { meta: Symbol.for("meta"), doc: Symbol.for("doc"), call: Symbol.for("call") } ================================================ FILE: src/components/Interpreter_OLD/utils.js ================================================ import { Subject, Observable, combineLatest, of } from "rxjs" import { map } from "rxjs/operators" export const forEach_async = async (array, callback) => { for (let index = 0; index < array.length; index++) { await callback(array[index], index, array) } } export const get_async = async (object, path, defaultValue) => { let index = 0 const length = path.length while (object !== null && index < length) { object = await object[path[index++]] } return (index && (index === length)) ? object : defaultValue } export const combineLatestObj = (obj) => { var sources = [] var keys = [] for (let key in obj) { if (obj.hasOwnProperty(key)) { sources.push(obj[key]) } } return combineLatest(sources, () => { var argsLength = arguments.length var combination = {} for (var i = argsLength - 1; i >= 0; i--) { combination[keys[i]] = arguments[i] } return combination; }) } ================================================ FILE: src/components/MonacoEditor/index.js ================================================ // import * as monaco from "monaco-editor" // (1) Desired editor features: import 'monaco-editor/esm/vs/editor/browser/controller/coreCommands.js'; import 'monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js'; // import 'monaco-editor/esm/vs/editor/browser/widget/diffEditorWidget.js'; // import 'monaco-editor/esm/vs/editor/browser/widget/diffNavigator.js'; import 'monaco-editor/esm/vs/editor/contrib/bracketMatching/bracketMatching.js'; import 'monaco-editor/esm/vs/editor/contrib/caretOperations/caretOperations.js'; // import 'monaco-editor/esm/vs/editor/contrib/caretOperations/transpose.js'; import 'monaco-editor/esm/vs/editor/contrib/clipboard/clipboard.js'; // import 'monaco-editor/esm/vs/editor/contrib/codelens/codelensController.js'; // import 'monaco-editor/esm/vs/editor/contrib/colorPicker/colorDetector.js'; import 'monaco-editor/esm/vs/editor/contrib/comment/comment.js'; import 'monaco-editor/esm/vs/editor/contrib/contextmenu/contextmenu.js'; import 'monaco-editor/esm/vs/editor/contrib/cursorUndo/cursorUndo.js'; import 'monaco-editor/esm/vs/editor/contrib/dnd/dnd.js'; import 'monaco-editor/esm/vs/editor/contrib/find/findController.js'; // import 'monaco-editor/esm/vs/editor/contrib/folding/folding.js'; import 'monaco-editor/esm/vs/editor/contrib/format/formatActions.js'; // import 'monaco-editor/esm/vs/editor/contrib/goToDeclaration/goToDeclarationCommands.js'; // import 'monaco-editor/esm/vs/editor/contrib/goToDeclaration/goToDeclarationMouse.js'; import 'monaco-editor/esm/vs/editor/contrib/gotoError/gotoError.js'; import 'monaco-editor/esm/vs/editor/contrib/hover/hover.js'; import 'monaco-editor/esm/vs/editor/contrib/inPlaceReplace/inPlaceReplace.js'; import 'monaco-editor/esm/vs/editor/contrib/linesOperations/linesOperations.js'; import 'monaco-editor/esm/vs/editor/contrib/links/links.js'; import 'monaco-editor/esm/vs/editor/contrib/multicursor/multicursor.js'; // import 'monaco-editor/esm/vs/editor/contrib/parameterHints/parameterHints.js'; // import 'monaco-editor/esm/vs/editor/contrib/quickFix/quickFixCommands.js'; import 'monaco-editor/esm/vs/editor/contrib/referenceSearch/referenceSearch.js'; import 'monaco-editor/esm/vs/editor/contrib/rename/rename.js'; import 'monaco-editor/esm/vs/editor/contrib/smartSelect/smartSelect.js'; // import 'monaco-editor/esm/vs/editor/contrib/snippet/snippetController2.js'; import 'monaco-editor/esm/vs/editor/contrib/suggest/suggestController.js'; import 'monaco-editor/esm/vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode.js'; import 'monaco-editor/esm/vs/editor/contrib/wordHighlighter/wordHighlighter.js'; import 'monaco-editor/esm/vs/editor/contrib/wordOperations/wordOperations.js'; // import 'monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.js'; // import 'monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.js'; // import 'monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js'; // import 'monaco-editor/esm/vs/editor/standalone/browser/quickOpen/quickOutline.js'; // import 'monaco-editor/esm/vs/editor/standalone/browser/quickOpen/gotoLine.js'; // import 'monaco-editor/esm/vs/editor/standalone/browser/quickOpen/quickCommand.js'; // import 'monaco-editor/esm/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js'; import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js'; import { renderMarkdown as rm } from 'monaco-editor/esm/vs/base/browser/htmlContentRenderer.js'; export const renderMarkdown = rm // (2) Desired languages: // import 'monaco-editor/esm/vs/language/typescript/monaco.contribution'; // import 'monaco-editor/esm/vs/language/css/monaco.contribution'; import 'monaco-editor/esm/vs/language/json/monaco.contribution'; // import 'monaco-editor/esm/vs/language/html/monaco.contribution'; // import 'monaco-editor/esm/vs/basic-languages/bat/bat.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/coffee/coffee.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/cpp/cpp.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/csharp/csharp.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/csp/csp.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/css/css.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/dockerfile/dockerfile.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/fsharp/fsharp.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/go/go.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/handlebars/handlebars.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/html/html.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/ini/ini.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/java/java.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/less/less.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/lua/lua.contribution.js'; import 'monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/msdax/msdax.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/mysql/mysql.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/objective-c/objective-c.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/pgsql/pgsql.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/php/php.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/postiats/postiats.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/powershell/powershell.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/pug/pug.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/python/python.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/r/r.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/razor/razor.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/redis/redis.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/redshift/redshift.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/ruby/ruby.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/sb/sb.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/scss/scss.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/solidity/solidity.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/swift/swift.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/vb/vb.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/xml/xml.contribution.js'; // import 'monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution.js'; const languageName = "L1" const language = { id: languageName, extensions: [".l1", ".L1"] } const languageConfiguration = { comments: { lineComment: ";" } } const provider = { brackets: [ ["{", "}", "delimiter.curly"], ["[", "]", "delimiter.square"], ["(", ")", "delimiter.parenthesis"], ["<", ">", "delimiter.angle"] ], tokenizer: { root: [ [/-?[0-9][0-9_]*(\.[0-9_]*)?/, "number"], [/\p{Lu}(\p{Ll}|\p{Lu}|\p{Lt}|\p{Lm}|\p{Lo}|[-_0-9])*/u, "type.identifier"], [/#(\p{Ll}|\p{Lu}|\p{Lt}|\p{Lm}|\p{Lo})(\p{Ll}|\p{Lu}|\p{Lt}|\p{Lm}|\p{Lo}|[-_0-9])*/u, "symbol"], [/(\p{Ll}|\p{Lu}|\p{Lt}|\p{Lm}|\p{Lo})(\p{Ll}|\p{Lu}|\p{Lt}|\p{Lm}|\p{Lo}|[-_0-9])*/u, "identifier"], [/[{}()\[\]]/, "@brackets"], [/"/, { token: "string.quote", bracket: "@open", next: "@string" } ], [/[;].*$/, "comment"], [/(\p{Po}|\p{Sm}|[\^\-])/u, "operator"] ], string: [ [/[^\\"]+/, "string"], [/"/, { token: "string.quote", bracket: "@close", next: "@pop" } ] ], } } const theme = { base: "vs", inherit: true, rules: [ { token: "operator", foreground: "ff0000" }, { token: "identifier", foreground: "3b8e23" }, { token: "symbol", foreground: "327a1f" }, { token: "type.identifier", foreground: "1459a9" }, { token: "number", foreground: "b1871b" }, { token: "string", foreground: "c225ca" }, { token: "comment", foreground: "73c0e2" }, ] } monaco.languages.register(language) monaco.languages.setLanguageConfiguration(languageName, languageConfiguration) monaco.editor.defineTheme(languageName, theme) monaco.languages.setMonarchTokensProvider(languageName, provider) const functions = ["Shape", "Rank", "Min", "Max", "RankUp", "Transpose", "RandomNormal", "RandomUniform"] monaco.languages.registerCompletionItemProvider(languageName, { provideCompletionItems: () => { return [ ...(functions.map(label => ({ label, kind: monaco.languages.CompletionItemKind.Function, documentation: "mu" }))), { label: 'ifelse', kind: monaco.languages.CompletionItemKind.Snippet, insertText: { value: [ 'if (${1:condition}) {', '\t$0', '} else {', '\t', '}' ].join('\n') }, documentation: 'If-Else Statement' } ] } }); export default monaco ================================================ FILE: src/components/Panel/index.js ================================================ import React, { PureComponent } from "react" import "./style.sass" export default class Panel extends PureComponent { state = { scrolled: false } onScroll = (e) => { if (e.target.scrollTop > 0 && !this.state.scrolled) { this.setState({ scrolled: true }) return } if (e.target.scrollTop === 0 && this.state.scrolled) { this.setState({ scrolled: false }) return } } render() { const scrolled = this.props.scrollable && this.state.scrolled const className = "panel" + (scrolled ? " scrolled" : "") + (this.props.disabled ? " disabled" : "") return (
    { this.props.children }
    ) } } ================================================ FILE: src/components/Panel/style.sass ================================================ .panel display: grid overflow-y: scroll overflow-x: hidden position: relative flex: 1 &::-webkit-scrollbar width: 5px &::-webkit-scrollbar-thumb border-radius: 10px background-color: rgba(100, 100, 100, .4) &:hover background-color: rgba(100, 100, 100, .7) &:active background-color: rgba(0, 0, 0, .6) &:after content: "" position: absolute width: calc(100% - 2px) left: 1px height: 6px border-radius: 5px box-shadow: #ddd 0 6px 6px -6px inset pointer-events: none opacity: 0 transition: opacity 0.2s &.scrolled:after opacity: 1 &.disabled filter: grayscale(1) opacity(0.5) > .header display: none &.property will-change: transform &:hover background-color: transparent !important border-color: lightgray !important ================================================ FILE: src/components/Parser/grammar.ohm ================================================ L1 { StartHere = Program Program = Assignment* Assignment = "_"? Path ":" Value ("\n"|",")? -- normal | "::" Path ("\n"|","|";")? -- import Function = (identifier) "=>" Expression Value = Expression Expression (an expression) = Pipeline Pipeline = Pipeline ("->"|"|>") (~Assignment Addition) -- binary | Addition -- fallthrough Addition = (Addition ("+"|"-") Multiplication) -- binary | Multiplication -- fallthrough | "+" Multiplication -- sum | "-" Multiplication -- negative Multiplication = (Multiplication ("*"|"×"|"/"|"÷"|"%"|"@"|"⊗") Exponentiation) -- binary | Exponentiation -- fallthrough | "*" Multiplication -- product | "/" Multiplication -- reciprocal Exponentiation = Access "^" Exponentiation -- binary | Access -- fallthrough Access = Access "." Path -- binary | FunctionApplication -- fallthrough FunctionApplication = PrimitiveExpression (~Assignment FunctionApplication)? PrimitiveExpression = "(" Value ")" -- paren | "'" PrimitiveExpression -- magic | Function | Object | Reference -- path | Tensor -- tensor | "[" "]" -- emptyTensor | "(" ")" -- none1 | "!" -- none2 | string Reference = Path Path = nonemptyListOf<(identifier | symbol), "."> Object (object) = "{" Program "}" Scalar = number Vector (vector) = "[" row "]" Matrix (matrix) = "[" rows "]" Tensor = (Scalar | Vector | Matrix) rows = nonemptyListOf row = spaceButNewLine* nonemptyListOf spaceButNewLine* rowSeparator = ("\n" | ",") spaceButNewLine = ~"\n" space number (a number) = "-"? (digit|"_")+ ("." (digit|"_")*)? string = "\"" (~"\"" any)* "\"" identifier (an identifier) = &letter (alnum | "_" | "-")+ symbol (a symbol) = "#" identifier // TODO: Comment that will comment out the rest of the program. space += lineComment lineComment = ((";") (~"\n" any)*) "\n"? } ================================================ FILE: src/components/Parser/index.js ================================================ import ohm from "ohm-js" import grammar from "./grammar.ohm" import semantics from "./semantics.js" class Parser { grammar = null semantics = null constructor() { this.grammar = ohm.grammar(grammar) this.semantics = this.grammar.createSemantics().addOperation(semantics.operation, semantics.actions) } parse = (code, issues) => { return new Promise(resolve => { const result = this.parseSync(code, issues) resolve(result) }) } parseSync = (code, issues) => { const match = this.grammar.match(code) const success = match.succeeded() if (success) { const semanticMatch = this.semantics(match) const result = semanticMatch[semantics.operation].call(semanticMatch) return { result } } else { const issue = { ...convertToLineNumberAndColumn(code, match.getRightmostFailurePosition()), message: "Expected " + match.getExpectedText(), severity: "error" } issues.next(issue) return { result: null } } } } export default new Parser export const convertToLineNumberAndColumn = (code, startOffset, endOffset) => { endOffset = endOffset || startOffset const start = getLineAndColumn(code, startOffset) const end = getLineAndColumn(code, endOffset) return { startLineNumber: start.lineNum, startColumn: start.colNum, endLineNumber: end.lineNum, endColumn: end.colNum, _value: code.substring(startOffset, endOffset) } } // import { getLineAndColumn } from "ohm/src/util" export const getLineAndColumn = function(str, offset) { var lineNum = 1; var colNum = 1; var currOffset = 0; var lineStartOffset = 0; var nextLine = null; var prevLine = null; var prevLineStartOffset = -1; while (currOffset < offset) { var c = str.charAt(currOffset++); if (c === '\n') { lineNum++; colNum = 1; prevLineStartOffset = lineStartOffset; lineStartOffset = currOffset; } else if (c !== '\r') { colNum++; } } // Find the end of the target line. var lineEndOffset = str.indexOf('\n', lineStartOffset); if (lineEndOffset === -1) { lineEndOffset = str.length; } else { // Get the next line. var nextLineEndOffset = str.indexOf('\n', lineEndOffset + 1); nextLine = nextLineEndOffset === -1 ? str.slice(lineEndOffset) : str.slice(lineEndOffset, nextLineEndOffset); // Strip leading and trailing EOL char(s). nextLine = nextLine.replace(/^\r?\n/, '').replace(/\r$/, ''); } // Get the previous line. if (prevLineStartOffset >= 0) { prevLine = str.slice(prevLineStartOffset, lineStartOffset) .replace(/\r?\n$/, ''); // Strip trailing EOL char(s). } // Get the target line, stripping a trailing carriage return if necessary. var line = str.slice(lineStartOffset, lineEndOffset).replace(/\r$/, ''); return { lineNum: lineNum, colNum: colNum, line: line, prevLine: prevLine, nextLine: nextLine }; }; ================================================ FILE: src/components/Parser/semantics.js ================================================ import { isEmpty } from "lodash-es" import dedent from "dedent" import { convertToLineNumberAndColumn } from "./index" const semantics = { operation: "eval", actions: { Program: function(data) { return { ...includeSource(this.source), type: "Program", value: data.eval() } }, Assignment_normal: function(f1, p, o, v, __) { const silent = (f1.sourceString === "_") const path = p.eval() const value = v.eval() return { ...includeSource(this.source), type: "Assignment", path, value, silent } }, Assignment_import: function(_, p, __) { const path = p.eval() return { ...includeSource(this.source), type: "Assignment", path: { ...includeSource(this.source), type: "Path", value: [path.value.slice(-1).pop()] }, value: { ...includeSource(this.source), type: "Reference", value: path } } }, FunctionApplication: function(fn, arg) { arg = arg.eval() fn = fn.eval() if (isEmpty(arg)) { return fn } return { ...includeSource(this.source), type: "FunctionApplication", direction: "backward", function: fn, argument: arg[0] } }, Pipeline_binary: function (arg, _, fn) { let argument = arg.eval() return { ...includeSource(this.source), type: "FunctionApplication", direction: "forward", function: fn.eval(), argument } }, Path: function(mu) { return { ...includeSource(this.source), type: "Path", value: mu.eval() } }, Function: function(argument, _, value) { return { ...includeSource(this.source), type: "Function", argument: argument.eval(), value: value.eval() } }, Object: function(_, data, __) { return { ...includeSource(this.source), type: "Object", value: data.eval() } }, Matrix: function(_, data, __) { return { ...includeSource(this.source), type: "TensorLiteral", rank: 2, value: data.eval() } }, Vector: function(_, data, __) { return { ...includeSource(this.source), type: "TensorLiteral", rank: 1, value: data.eval() } }, Scalar: function(data) { return { ...includeSource(this.source), type: "TensorLiteral", rank: 0, value: data.eval() } }, // Ohm, why are you like this? Addition_binary: function(l, op, r) { return binaryOperation(l, op, r, this.source) }, Multiplication_binary: function(l, op, r) { return binaryOperation(l, op, r, this.source) }, Exponentiation_binary: function(l, op, r) { return binaryOperation(l, op, r, this.source) }, Access_binary: function(l, op, r) { return binaryOperation(l, op, r, this.source) }, PrimitiveExpression_tensor: function(value) { return { ...includeSource(this.source), type: "Tensor", value: value.eval() } }, Addition_sum: function(op, v) { return unaryOperation(op, v, this.source) }, Addition_negative: function(op, v) { return unaryOperation(op, v, this.source) }, Multiplication_product: function(op, v) { return unaryOperation(op, v, this.source) }, Multiplication_reciprocal: function(op, v) { return unaryOperation(op, v, this.source) }, PrimitiveExpression_magic: function(op, v) { return unaryOperation(op, v, this.source) }, PrimitiveExpression_paren: function(_, v, __) { return v.eval() }, PrimitiveExpression_none1: function(_, __) { return { ...includeSource(this.source), ...None } }, PrimitiveExpression_none2: function(_) { return { ...includeSource(this.source), ...None } }, PrimitiveExpression_emptyTensor: function(_, __) { return { ...includeSource(this.source), type: "Tensor", value: { type: "TensorLiteral", rank: 0, value: [] } } }, Reference: function(path) { return { ...includeSource(this.source), type: "Reference", value: path.eval() } }, row: function(_, data, __) { return data.eval() }, rows: function(data) { return data.eval() }, identifier: function(_, __) { return this.sourceString }, symbol: function(_, identifier) { return Symbol.for(identifier.eval()) }, number: function(_, __, ___, ____) { const v = this.sourceString.replace(/_/g, "") return parseFloat(v, 10) }, string: function(_, value, __) { return { ...includeSource(this.source), type: "String", value: dedent(value.sourceString) } }, nonemptyListOf: function(x, _, xs) { return [x.eval()].concat(xs.eval()) } } } const unaryOperation = (op, value, source) => ({ ...includeSource(source), type: "Operation", operator: op.sourceString, left: None, right: value.eval() }) const binaryOperation = (left, op, right, source) => ({ ...includeSource(source), type: "Operation", operator: op.sourceString, left: left.eval(), right: right.eval() }) const includeSource = (source) => ({ _source: convertToLineNumberAndColumn(source.sourceString, source.startIdx, source.endIdx) }) const None = { type: "None" } const EmptyTensor = { type: "Tensor" } export default semantics ================================================ FILE: src/components/Spinner/index.js ================================================ import React from "react" import "./style.sass" export default (props) => (
    ) // https://www.cssscript.com/ios-os-x-style-pure-css-loading-spinner/ ================================================ FILE: src/components/Spinner/style.sass ================================================ $spinner-color: #69717d !default $spinner-size: 48px !default .spinner font-size: $spinner-size position: relative display: inline-block width: 1em height: 1em &.center position: absolute left: 0 right: 0 top: 0 bottom: 0 margin: auto .spinner-blade position: absolute left: .4629em bottom: 0 width: .074em height: .2777em border-radius: .0555em background-color: transparent transform-origin: center -.2222em animation: spinner-fade 1s infinite linear $animation-delay: 0s $blade-rotation: 0deg @for $i from 1 through 12 &:nth-child(#{$i}) animation-delay: $animation-delay transform: rotate($blade-rotation) $blade-rotation: $blade-rotation + 30 $animation-delay: $animation-delay + .083 @keyframes spinner-fade 0% background-color: $spinner-color 100% background-color: transparent ================================================ FILE: src/components/Studio/hello-world.l1 ================================================ hello-world: 23 + 24 ; Uncomment following line for more: ; ::Self ================================================ FILE: src/components/Studio/index.js ================================================ import React, { PureComponent } from "react" import { of } from "rxjs" import { Base64 } from "js-base64" import "normalize.css" import "./style.sass" import Editor from "../Editor" import Evaluator from "../Evaluator" import Board from "../Board" import Panel from "../Panel" import helloWorldCode from "./hello-world.l1" const encodeSource = (code) => Base64.encode(code) const decodeHash = (hash) => { try { return Base64.decode(hash) } catch (e) { return undefined } } const codeFromHash = decodeHash(document.location.hash.substring(1)) if (codeFromHash) { history.replaceState({ code: codeFromHash, saved: true, timestamp: Date.now() }, "", "#" + encodeSource(codeFromHash)) } const defaultCode = codeFromHash || helloWorldCode export default class Studio extends PureComponent { _editor = null state = { code: defaultCode, ast: null, computedValues: of({}), outOfSync: false } _onPopState = (e) => { if (e.state && e.state.code) { this._editor.setContent(e.state.code) } } componentDidMount() { window.addEventListener("popstate", this._onPopState) window.loadCode = (hash) => { const code = decodeHash(hash) this._editor.setContent(code) history.pushState({ code, saved: true, timestamp: Date.now() }, "", "#" + hash) } } componentWillUnmount() { window.removeEventListener("popstate", this._onPopState) } handleHistory(code) { if (code !== this.state.code) { if (history.state) { if (history.state.saved || false) { history.pushState({ code, saved: false, timestamp: Date.now() }, "", "#") } else { history.replaceState({ code, saved: false, timestamp: Date.now() }, "", "#") } } else { history.pushState({ code, saved: false, timestamp: Date.now() }, "", "#") } } } codeChanged = async (code, editor, issues, forced) => { if (!forced) { this.handleHistory(code) } const result = await Evaluator.evaluate(code, {}, issues) if (result.ast) { this.setState({ ...result, outOfSync: false }) } else { this.setState({ code, outOfSync: true }) } } saveCode = () => { history.replaceState({ code: this.state.code, saved: true, timestamp: Date.now() }, "", "#" + encodeSource(this.state.code)) } render() { return (
    this._editor = e} content={this.state.code} language="L1" theme="L1" onChange={this.codeChanged} onExecute={this.codeChanged.bind(this, this.state.code)} onSave={this.saveCode} /> {/* */}
    ) } } ================================================ FILE: src/components/Studio/style.sass ================================================ @import "~firacode/distr/fira_code.css" html, body overflow: hidden .studio display: grid grid-template-columns: repeat(auto-fit, minmax(20em, 1fr)) grid-template-rows: minmax(10em, 1fr) grid-gap: 0.5em height: 100vh width: 100vw padding: 0.5em box-sizing: border-box ================================================ FILE: src/components/Studio/test.worker.js ================================================ // Post data to parent thread // self.postMessage({ foo: "foo" }) // Respond to message from parent thread // self.addEventListener("message", (event) => { // const code = event.data.code // }) // From the main thread // import Worker from "./test.worker" // const worker = new Worker() // worker.addEventListener("message", (event) => { // console.log("Message from worker", event) // }) // worker.postMessage({ code }) ================================================ FILE: src/gallery/README.md ================================================ # Examples - [Hello World](https://mlajtos.github.io/L1/latest/#aGVsbG8td29ybGQ6IDIzICsgMjQKCjsgVW5jb21tZW50IGZvbGxvd2luZyBsaW5lIGZvciBtb3JlOgo7IDo6U2VsZg==) - [Built-in RTFM](https://mlajtos.github.io/L1/latest/#OjpTZWxm) – self-hosted documentation - [Current Promo](https://mlajtos.github.io/L1/latest/#YTogWzEgMiAzXSAgICAgICAgICA7IGNvbnN0IGEgPSB0Zi50ZW5zb3IoWzEsIDIsIDNdKQpiOiBbMSwyLDNdICAgICAgICAgIDsgY29uc3QgYiA9IHRmLnRlbnNvcihbWzFdLCBbMl0sIFszXV0pCmM6IFNoYXBlIGEgLT4gRXllICAgOyBjb25zdCBjID0gdGYuZXllKGEuc2hhcGVbMF0pCmQ6IChhICogYileYyAgICAgICAgOyBjb25zdCBkID0gYS5tdWwoYikucG93KGMp) – [Current promo code](https://github.com/mlajtos/L1/blob/master/Screenshots/Screenshot4.png) with JS equivalent - [Old Promo](https://mlajtos.github.io/L1/latest/#OyBMMTogVGVuc29yIFN0dWRpbyAKOwo7ICAgIkxpdmUtY29kaW5nIHdpdGggVGVuc29ycyIKOwo7ICAgICAgIGh0dHBzOi8vbWxhanRvcy5naXRodWIuaW8vTDEKCgo7IEV4YW1wbGU6CjsgICBNdWx0aXBseWluZyByb3cgYW5kIGNvbHVtbiB2ZWN0b3IKCng6IFsxIDIgM10KeTogWzEsMiwzXQp6OiB4ICogeQ==) – [Old promo code](https://github.com/mlajtos/L1/blob/master/Screenshots/Screenshot.png) - [Activation Functions on Random Distributions](https://mlajtos.github.io/L1/latest/#OyBHYWxsZXJ5IG9mIEFjdGl2YXRpb24gRnVuY3Rpb25zIG9uIFJhbmRvbSBEaXN0cmlidXRpb25zCgpfZ2FsbGVyeTogeCA9PiB7CiAgICBpZGVudGl0eTogeAogICAgcmVsdTogUmVjdGlmaWVkTGluZWFyVW5pdCB4CiAgICBzaWdtb2lkOiBTaWdtb2lkIHgKICAgIGVsdTogRXhwb25lbnRpYWxMaW5lYXJVbml0IHgKICAgIHNlbHU6IFNjYWxlZEV4cG9uZW50aWFsTGluZWFyVW5pdCB4CiAgICBzaW46IFNpbmUgeAogICAgbG9nOiBMb2dhcml0aG0geAogICAgc29mdHBsdXM6IFNvZnRwbHVzIHgKfQpfc2hhcGU6IFsxMDAgMTAwXQpfdGVzdDogcmFuZG9tRGlzdHJpYnV0aW9uID0+IGdhbGxlcnkgcmFuZG9tRGlzdHJpYnV0aW9uIHNoYXBlCgpyYW5kb20tbm9ybWFsOiB0ZXN0IFJhbmRvbU5vcm1hbApyYW5kb20tdW5pZm9ybTogdGVzdCBSYW5kb21Vbmlmb3JtCg==) - illustration of what an activation function can do to a random tensor - [Closures](https://mlajtos.github.io/L1/latest/#OyBFeGFtcGxlIG9mIGNsb3N1cmVzCgptYWtlQWRkZXI6IHggPT4geSA9PiB4ICsgeQphZGQ1OiBtYWtlQWRkZXIgNQphZGQxMDogbWFrZUFkZGVyIDEwCgp0ZXN0MTogYWRkNSAyCnRlc3QyOiBhZGQxMCAy) – basically a super-power - [Range](https://mlajtos.github.io/L1/latest/#UmFuZ2U6IHsKICAgICNkb2M6ICIKICAgICAgICAjIFJhbmdlCiAgICAgICAgUmV0dXJucyByYW5nZSBvZiB2YWx1ZXMgZnJvbSB0ZW5zb3IKCiAgICAgICAgYGBgCiAgICAgICAgYTogUmFuZ2UgWzEgMiAzXSA7IGE6IDIKICAgICAgICBgYGAKICAgICIKICAgICNjYWxsOiBhID0+IE1heCBhIC0gTWluIGEKfQoKZGF0YTogUmFuZG9tTm9ybWFsIFsyMCAyMF0KcmFuZ2U6IFJhbmdlIGRhdGE=) – Sample implementation of functional object, including documentation - [Hidden Assignment](https://mlajtos.github.io/L1/latest/#OyBBc3NpZ25tZW50IHByZWZpeGVkIHdpdGggdW5kZXJzY29yZSBpcyBoaWRkZW4KCl9wcml2YXRlU3R1ZmY6IHsKICAgIGE6IDIKICAgIHN0cjogIgogICAgICAgICMjIyBIZWxsbwogICAgICAgIEhvdyBhcmUgeW91PwogICAgIgogICAgZm46IHggPT4gYSAqIHggKyAxCn0KCiNkb2M6IHByaXZhdGVTdHVmZi5zdHIKbXU6IChwcml2YXRlU3R1ZmYuZm4gMjMp) – unimportant assignments can be *silenced* - [Logo](https://mlajtos.github.io/L1/latest/#TDE6IFsKICAgIDAgMCAwIDAgMCAwIDAKICAgIDAgMSAwIDAgMSAxIDAKICAgIDAgMSAwIDAgMCAxIDAKICAgIDAgMSAwIDAgMCAxIDAKICAgIDAgMSAwIDAgMCAxIDAKICAgIDAgMSAxIDEgMCAxIDAKICAgIDAgMCAwIDAgMCAwIDAKXQ==) – silly example demonstrating matrix literal - [Sine Experiment](https://mlajtos.github.io/L1/latest/#SW90YTogewogICAgI2RvYzogIgogICAgICAgICMgSW90YQogICAgICAgIAogICAgICAgIFByb2R1Y2VzIGEgdmVjdG9yIG9mIGxlbmd0aCBgbmAgd2l0aCB2YWx1ZXMgZnJvbSBgMWAgdG8gYG5gCgogICAgICAgICAgICBhOiBJb3RhIDMgOyBhID0gWzEgMiAzXQogICAgIgogICAgI2NhbGw6IGkgPT4gTGluZWFyU3BhY2UgewogICAgICAgIHN0YXJ0OiAxCiAgICAgICAgc3RvcDogaQogICAgICAgIGNvdW50OiBpCiAgICB9Cn0KCmE6IElvdGEgNTAgLT4gRXhwYW5kIDAKYjogYSAqIFRyYW5zcG9zZSBhCmM6IFNpbmUgYg==) – weird example - [Cosine Experiment](https://mlajtos.github.io/L1/latest/#X2E6IExpbmVhclNwYWNlIHsKICAgIHN0YXJ0OiAwCiAgICBzdG9wOiAxMAogICAgY291bnQ6IDEwMDAKfSAtPiBFeHBhbmQgMApfYjogVHJhbnNwb3NlIGEKX2M6IGEgKiBiCmQ6IENvc2luZSBj) – another weird pattern - [Sine Experiment 2](https://mlajtos.github.io/L1/latest/#X3Jlc29sdXRpb246IDEwMDAKX3JhbmdlOiAxMAoKX2E6IExpbmVhclNwYWNlIHsKICAgIHN0YXJ0OiAtcmFuZ2UKICAgIHN0b3A6IHJhbmdlCiAgICBjb3VudDogcmVzb2x1dGlvbgp9CgpfYjogYSAtPiBFeHBhbmQgMQoKX2M6IFRyYW5zcG9zZSBiCl9kOiBjICogYgplOiBTaW5lIGQ=) – beautiful pattern - [Random Number of Random Numbers](https://mlajtos.github.io/L1/latest/#I2RvYzogIgogICAgIyBSYW5kb20gTnVtYmVyIG9mIFJhbmRvbSBOdW1iZXJzCgogICAgSG93IGRvIHlvdSBkbyB0aGlzIGluIFRlbnNvckZsb3cgb3IgUHlUb3JjaD8KIgoKcmFuZG86CiAgICBSYW5kb21Vbmlmb3JtICEKICAgIC0+IHIgPT4gMSArIDEwICogcgogICAgLT4gRmxvb3IKICAgIC0+IFJhbmRvbU5vcm1hbA==) – demonstration of simple flexibility ## Prototyping new language features - [Pattern Matching 1](https://mlajtos.github.io/L1/latest/#c29tZURhdGE6IHttaW46IDIsIG1heDozIH0KCmE6IHNvbWVEYXRhCiAgICAgPyB7bWluLCBtYXh9CiAgICAgICAgLT4gQ2xpcCB7IG1pbiwgbWF4IH0KICAgICA/IHttYXh9CiAgICAgICAgLT4gQ2xpcCB7IG1heCB9CiAgICAgPyB7bWlufQogICAgICAgIC0+IENsaXAgeyBtaW4gfQogICAgID8ge30KICAgICAgICAtPiBbXQ==) – an example of how pattern-matching could work in the future - [Pattern Matching 2](https://mlajtos.github.io/L1/latest/#c29tZURhdGE6IHsgbWluOiAyLCBtYXg6MyB9CgphOiBzb21lRGF0YSA/CiAgICAge21pbiwgbWF4fSAtPiBDbGlwIHsgbWluLCBtYXggfQogICAgIHttYXh9ICAgICAgLT4gQ2xpcCB7IG1heCB9CiAgICAge21pbn0gICAgICAtPiBDbGlwIHsgbWluIH0KICAgICB7fSAgICAgICAgIC0+IFtd) – slightly better syntax (no idea about parsability) ================================================ FILE: src/gallery/future/functional_object.l1 ================================================ mu: { #call: a => { precheck: (precondition a) value: precheck ? (transform a) : a postcheck: (postcondition value) returnValue: postcheck ? value : a }.returnValue precondition: a => (0 <= a) && (a < 100) transform: a => (a + 1) postcondition: a => (a <= 100) } res0: mu -2 res1: mu -1 res2: mu 0 res3: mu 99 res4: mu 100 res5: mu 101 ================================================ FILE: src/gallery/future/interactive_tensors.l1 ================================================ x: Transpose RankUp Iota Mouse.x y: RankUp Iota Mouse.y mu: x @ y ================================================ FILE: src/gallery/old/0_helloWorld.l1 ================================================ hello-world: 23 + 24 ; Uncomment following line for more: ; ::Self ================================================ FILE: src/gallery/old/10_simple_model.js ================================================ const a = tf.variable(tf.scalar(Math.random())); const b = tf.variable(tf.scalar(Math.random())); const c = tf.variable(tf.scalar(Math.random())); const d = tf.variable(tf.scalar(Math.random())); function predict(x) { // y = a * x ^ 3 + b * x ^ 2 + c * x + d return tf.tidy(() => { return a.mul(x.pow(tf.scalar(3))) // a * x^3 .add(b.mul(x.square())) // + b * x ^ 2 .add(c.mul(x)) // + c * x .add(d); // + d }); } function loss(predictions, labels) { // Subtract our labels (actual values) from predictions, square the results, // and take the mean. const meanSquareError = predictions.sub(labels).square().mean(); return meanSquareError; } const learningRate = 0.5; const optimizer = tf.train.sgd(learningRate); function train(xs, ys, numIterations = 75) { const learningRate = 0.5; const optimizer = tf.train.sgd(learningRate); for (let iter = 0; iter < numIterations; iter++) { optimizer.minimize(() => { const predsYs = predict(xs); return loss(predsYs, ys); }); } } for (let iter = 0; iter < numIterations; iter++) { optimizer.minimize(() => { const predsYs = predict(xs); return loss(predsYs, ys); }); } ================================================ FILE: src/gallery/old/13_edge_detection_pipeline.l1 ================================================ ; pipeline version Fn: MaxPool { filterSize: 2 strides: 1 } e: GetDigit 5 -> ExpandDimension { axis: 2 } -> a => (Fn a) + (Fn -a) ;-> ResizeBilinear { shape: 2 * (Shape $) } -> a => a -> ResizeBilinear { shape: 2 * (Shape a) } ================================================ FILE: src/gallery/old/14_edge_detection_compressed.l1 ================================================ mu.in: GetDigit 5 mu: { a: ExpandDimension {tensor: mu.in axis: 2} Fn: x => MaxPool { tensor: x filterSize: 2 strides: 1 } d: (Fn a) + (Fn -a) mu.out: d } a: mu.out ================================================ FILE: src/gallery/old/18_average_digit.l1 ================================================ digit: 4 samplesToAverage: 1000 averageDigit: d => { summed: Iterate { f: a => a + (GetDigit digit) count: samplesToAverage } averageDigit: summed (Zeros [28 28]) / samplesToAverage } mu: averageDigit digit gu: mu.averageDigit ================================================ FILE: src/gallery/old/19_nth_order_gradient.l1 ================================================ f: Sigmoid nthOrderGradient: cfg => Iterate { f: Gradient cfg.f count: cfg.n } grad: nthOrderGradient { f: f n: 1 } interval: (Iota 100 - 50) fn: f interval gradient: grad interval ================================================ FILE: src/gallery/old/20_maxPool_translation.l1 ================================================ ; MaxPool can do translation digit: 5 iterations: 10 RankUp: t => ExpandDimension { tensor: t axis: 2 } iterateMaxPool: Iterate { f: a => MaxPool { tensor: -a ; changing the sign every iteration filterSize: 2 } count: iterations } x: RankUp (GetDigit digit) mu: iterateMaxPool x ================================================ FILE: src/gallery/old/22_polynomial_regression.l1 ================================================ _Data: { xs: Transpose RankUp (1 + Iota 1000) ys: xs + 5 } Model: { b: 1 $c: 1 _predict: x => x * b + c _loss: labels => predictions => (labels - predictions)^2 -> Mean { axis: 0 } -> Sum { axis: 0 } _step: y => x => (loss y) (predict x) test: { p: predict Data.xs l: (loss Data.ys) p s: (step Data.ys) Data.xs } } Optimizer: { config: { learningRate: 0.03 maxIterations: 1000 maxTime: 2000 } _optimize: StochasticGradientDescent config stats: optimize (a => (Model.step Data.ys) Data.xs) mu: Round (Transpose RankUp ((Iota 10) / 10) @ RankUp stats) } ================================================ FILE: src/gallery/old/23_regress_tensor.l1 ================================================ #doc: " # Regress Tensor Fitting a random tensor without any input ## Needed fixes 1. reuse Variable from old interpreter 1. create `$` operator for Variable 1. reintroduce `StochasticGradientDescent` with live plot ## Nice things 1. None as a lamda argument " _Data: { target: RandomNormal [20 20] -> (x => x^2 + x + 3) } _Model: { ; $ === Variable ; prediction: $ RandomNormal [20 20] prediction: RandomNormal [20 20] ; Here would be better if None could be used: ; () => prediction predict: x => prediction loss: predictions => labels => +(predictions - labels)^2 step: y => predict! -> loss y } _Optimizer: { optimize: StochasticGradientDescent { learningRate: 0.3 maxIterations: 1000 maxTime: 1000 } ; Again, None as an argument ; () => Model.step Data.target loss: a => Model.step Data.target ; Stats should be an Observable with plot stats: optimize loss } ::Model.prediction ::Data.target ================================================ FILE: src/gallery/old/23_sine_exp.l1 ================================================ _samples: 1000 _a: Iota samples a_sin: a * Sine a _offset: 100000 _b: offset + Iota samples b_sin: (Sine b) / b c: a_sin * Transpose (RankUp b_sin) ================================================ FILE: src/gallery/old/24_RankDown.l1 ================================================ _RankDown: a => (ExpandDimension { axis: Rank a }) a a: [1 2, 3 4] b: RankUp a c: RankDown a ================================================ FILE: src/gallery/old/24_cascade.l1 ================================================ count: 10 Cascade: (Flow { fn: a => {::a} ::count }) {} ================================================ FILE: src/gallery/old/27_coffee.l1 ================================================ guesses: [ 4900 5400 7000 11136 3500 7175 3300 3801 4321 8500 6600 8091 5000 3400 3259 3000 2637 5354 ] work-days: 40 people: 50 cups-per-person: 6 cups-count: work-days * people * cups-per-person ================================================ FILE: src/gallery/old/5_tile_design.l1 ================================================ length: 28 range: 3.14159 a: Cosine LinearSpace { start: -range, stop: range, num: length } b: ExpandDimension { tensor: a, axis: 1 } d: Tile { tensor: b, reps: [1 28] } f: d * (Transpose d) e1: GetDigit 4 i: e1 * f ================================================ FILE: src/gallery/old/6_random_test.l1 ================================================ e: 2.71828182845904 x: GetDigit 3 a: RandomUniform {shape: [28 28]} b: RandomUniform {shape: [28 28]} y_1: a*e^x y_2: b*e^-x y: y_1 - y_2 z: RectifiedLinearUnit y ================================================ FILE: src/gallery/old/7_edge_detection.l1 ================================================ a: ExpandDimension { tensor: GetDigit 5 axis: 2 } Fn: x => MaxPool { tensor: x filterSize: 2 strides: 1 } d: Fn a + Fn (-a) e: ResizeBilinear { tensor: d shape: [100 100] } ================================================ FILE: src/gallery/old/9_higher-order_fns.l1 ================================================ d: GetDigit 5 x: RandomNormal {shape: Shape d} Fn: x => x^2 + x y: Fn x GradFn: (Gradient Fn) mu: GradFn x ================================================ FILE: src/index.html ================================================ Tensor Studio
    ================================================ FILE: src/index.js ================================================ import ReactDOM from "react-dom" import React from "react" import Studio from "./components/Studio" self.MonacoEnvironment = { getWorkerUrl: function (moduleId, label) { if (label === "json") { return "./json.worker.js"; } // if (label === "css") { // return "./css.worker.js"; // } // if (label === "html") { // return "./html.worker.js"; // } // if (label === "typescript" || label === "javascript") { // return "./ts.worker.js"; // } return "./editor.worker.js"; } } ReactDOM.render(, document.querySelector("#studio")) module.hot.accept() ================================================ FILE: src/test.js ================================================ const tests = require.context("./__tests__/", true, /.*/) const runTests = (ctx, callback) => { ctx.keys().forEach(test => callback(test, ctx)) } runTests(tests, (test, ctx) => { try { ctx(test) } catch (e) { console.log(test, e) } }) ================================================ FILE: webpack.config.js ================================================ const path = require("path") const webpack = require("webpack") const HtmlWebpackPlugin = require("html-webpack-plugin") const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin const FaviconsWebpackPlugin = require("favicons-webpack-plugin") module.exports = { mode: "production", entry: { hotReload: "react-hot-loader/patch", app: "./src/index.js", // tests: "./src/test.js", "editor.worker": "monaco-editor/esm/vs/editor/editor.worker.js", "json.worker": "monaco-editor/esm/vs/language/json/json.worker", }, output: { path: path.resolve(__dirname, "dist"), filename: "[name].js", globalObject: "this" }, module: { rules: [ { test: /\.s[ac]ss$/, use: ["style-loader", "css-loader", "sass-loader"] }, { test: /\.css$/, use: ["style-loader", "css-loader"] }, { test: /\.(png|woff|woff2|eot|ttf|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader?limit=100000" }, { test: /\.(l1|ohm|md)$/, loader: "raw-loader" }, { test: /\.(bin)$/, loader: "buffer-loader" }, { test: /\.worker\.js$/, loader: "worker-loader" }, { test: /\.(js|jsx)$/, exclude: /node_modules/, use: ["babel-loader"] } ] }, resolve: { extensions: ["*", ".js", ".jsx"] }, plugins: [ new HtmlWebpackPlugin({ chunks: ["app"], hash: true, template: "./src/index.html", filename: "index.html" }), new webpack.IgnorePlugin(/^((fs)|(path)|(os)|(crypto)|(source-map-support))$/, /vs\/language\/typescript\/lib/), new webpack.optimize.AggressiveMergingPlugin(), new webpack.HotModuleReplacementPlugin(), new FaviconsWebpackPlugin({ logo: "./src/favicon.png", prefix: "icons-[hash]/", inject: true, background: "#fff", title: "L1" }), // new BundleAnalyzerPlugin() ], devServer: { contentBase: path.join(__dirname, "dist"), compress: true, hot: true, port: 7171, stats: "errors-only", logLevel: "info", clientLogLevel: "warning", overlay: true } }