@pyscript/core 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,8 +29,15 @@
29
29
  # pyscript.magic_js. This is the blessed way to access them from pyscript,
30
30
  # as it works transparently in both the main thread and worker cases.
31
31
 
32
- from pyscript.magic_js import RUNNING_IN_WORKER, PyWorker, window, document, sync, current_target
33
32
  from pyscript.display import HTML, display
33
+ from pyscript.magic_js import (
34
+ RUNNING_IN_WORKER,
35
+ PyWorker,
36
+ current_target,
37
+ document,
38
+ sync,
39
+ window,
40
+ )
34
41
 
35
42
  try:
36
43
  from pyscript.event_handling import when
@@ -38,6 +45,5 @@ except:
38
45
  from pyscript.util import NotSupported
39
46
 
40
47
  when = NotSupported(
41
- "pyscript.when",
42
- "pyscript.when currently not available with this interpreter"
48
+ "pyscript.when", "pyscript.when currently not available with this interpreter"
43
49
  )
@@ -148,9 +148,23 @@ def _write(element, value, append=False):
148
148
  def display(*values, target=None, append=True):
149
149
  if target is None:
150
150
  target = current_target()
151
+ elif not isinstance(target, str):
152
+ raise TypeError(f"target must be str or None, not {target.__class__.__name__}")
153
+ elif target == "":
154
+ raise ValueError("Cannot have an empty target")
155
+ elif target.startswith("#"):
156
+ # note: here target is str and not None!
157
+ # align with @when behavior
158
+ target = target[1:]
151
159
 
152
160
  element = document.getElementById(target)
153
161
 
162
+ # If target cannot be found on the page, a ValueError is raised
163
+ if element is None:
164
+ raise ValueError(
165
+ f"Invalid selector with id={target}. Cannot be found in the page."
166
+ )
167
+
154
168
  # if element is a <script type="py">, it has a 'target' attribute which
155
169
  # points to the visual element holding the displayed values. In that case,
156
170
  # use that.
@@ -1,5 +1,5 @@
1
- from pyscript.util import NotSupported
2
1
  import js as globalThis
2
+ from pyscript.util import NotSupported
3
3
 
4
4
  RUNNING_IN_WORKER = not hasattr(globalThis, "document")
5
5
 
@@ -7,8 +7,9 @@ if RUNNING_IN_WORKER:
7
7
  import polyscript
8
8
 
9
9
  PyWorker = NotSupported(
10
- 'pyscript.PyWorker',
11
- 'pyscript.PyWorker works only when running in the main thread')
10
+ "pyscript.PyWorker",
11
+ "pyscript.PyWorker works only when running in the main thread",
12
+ )
12
13
  window = polyscript.xworker.window
13
14
  document = window.document
14
15
  sync = polyscript.xworker.sync
@@ -21,11 +22,12 @@ if RUNNING_IN_WORKER:
21
22
  else:
22
23
  import _pyscript
23
24
  from _pyscript import PyWorker
25
+
24
26
  window = globalThis
25
27
  document = globalThis.document
26
28
  sync = NotSupported(
27
- 'pyscript.sync',
28
- 'pyscript.sync works only when running in a worker')
29
+ "pyscript.sync", "pyscript.sync works only when running in a worker"
30
+ )
29
31
 
30
32
  # in MAIN the current element target exist, just use it
31
33
  def current_target():
@@ -1,10 +1,10 @@
1
1
  // ⚠️ This file is an artifact: DO NOT MODIFY
2
2
  export default {
3
3
  "pyscript": {
4
- "__init__.py": "# Some notes about the naming conventions and the relationship between various\n# similar-but-different names.\n#\n# import pyscript\n# this package contains the main user-facing API offered by pyscript. All\n# the names which are supposed be used by end users should be made\n# available in pyscript/__init__.py (i.e., this file)\n#\n# import _pyscript\n# this is an internal module implemented in JS. It is used internally by\n# the pyscript package, end users should not use it directly. For its\n# implementation, grep for `interpreter.registerJsModule(\"_pyscript\",\n# ...)` in core.js\n#\n# import js\n# this is the JS globalThis, as exported by pyodide and/or micropython's\n# FFIs. As such, it contains different things in the main thread or in a\n# worker.\n#\n# import pyscript.magic_js\n# this submodule abstracts away some of the differences between the main\n# thread and the worker. In particular, it defines `window` and `document`\n# in such a way that these names work in both cases: in the main thread,\n# they are the \"real\" objects, in the worker they are proxies which work\n# thanks to coincident.\n#\n# from pyscript import window, document\n# these are just the window and document objects as defined by\n# pyscript.magic_js. This is the blessed way to access them from pyscript,\n# as it works transparently in both the main thread and worker cases.\n\nfrom pyscript.magic_js import RUNNING_IN_WORKER, PyWorker, window, document, sync, current_target\nfrom pyscript.display import HTML, display\n\ntry:\n from pyscript.event_handling import when\nexcept:\n from pyscript.util import NotSupported\n\n when = NotSupported(\n \"pyscript.when\",\n \"pyscript.when currently not available with this interpreter\"\n )\n",
5
- "display.py": "import base64\nimport html\nimport io\nimport re\n\nfrom pyscript.magic_js import current_target, document, window\n\n_MIME_METHODS = {\n \"__repr__\": \"text/plain\",\n \"_repr_html_\": \"text/html\",\n \"_repr_markdown_\": \"text/markdown\",\n \"_repr_svg_\": \"image/svg+xml\",\n \"_repr_pdf_\": \"application/pdf\",\n \"_repr_jpeg_\": \"image/jpeg\",\n \"_repr_png_\": \"image/png\",\n \"_repr_latex\": \"text/latex\",\n \"_repr_json_\": \"application/json\",\n \"_repr_javascript_\": \"application/javascript\",\n \"savefig\": \"image/png\",\n}\n\n\ndef _render_image(mime, value, meta):\n # If the image value is using bytes we should convert it to base64\n # otherwise it will return raw bytes and the browser will not be able to\n # render it.\n if isinstance(value, bytes):\n value = base64.b64encode(value).decode(\"utf-8\")\n\n # This is the pattern of base64 strings\n base64_pattern = re.compile(\n r\"^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$\"\n )\n # If value doesn't match the base64 pattern we should encode it to base64\n if len(value) > 0 and not base64_pattern.match(value):\n value = base64.b64encode(value.encode(\"utf-8\")).decode(\"utf-8\")\n\n data = f\"data:{mime};charset=utf-8;base64,{value}\"\n attrs = \" \".join(['{k}=\"{v}\"' for k, v in meta.items()])\n return f'<img src=\"{data}\" {attrs}></img>'\n\n\ndef _identity(value, meta):\n return value\n\n\n_MIME_RENDERERS = {\n \"text/plain\": html.escape,\n \"text/html\": _identity,\n \"image/png\": lambda value, meta: _render_image(\"image/png\", value, meta),\n \"image/jpeg\": lambda value, meta: _render_image(\"image/jpeg\", value, meta),\n \"image/svg+xml\": _identity,\n \"application/json\": _identity,\n \"application/javascript\": lambda value, meta: f\"<script>{value}<\\\\/script>\",\n}\n\n\nclass HTML:\n \"\"\"\n Wrap a string so that display() can render it as plain HTML\n \"\"\"\n\n def __init__(self, html):\n self._html = html\n\n def _repr_html_(self):\n return self._html\n\n\ndef _eval_formatter(obj, print_method):\n \"\"\"\n Evaluates a formatter method.\n \"\"\"\n if print_method == \"__repr__\":\n return repr(obj)\n elif hasattr(obj, print_method):\n if print_method == \"savefig\":\n buf = io.BytesIO()\n obj.savefig(buf, format=\"png\")\n buf.seek(0)\n return base64.b64encode(buf.read()).decode(\"utf-8\")\n return getattr(obj, print_method)()\n elif print_method == \"_repr_mimebundle_\":\n return {}, {}\n return None\n\n\ndef _format_mime(obj):\n \"\"\"\n Formats object using _repr_x_ methods.\n \"\"\"\n if isinstance(obj, str):\n return html.escape(obj), \"text/plain\"\n\n mimebundle = _eval_formatter(obj, \"_repr_mimebundle_\")\n if isinstance(mimebundle, tuple):\n format_dict, _ = mimebundle\n else:\n format_dict = mimebundle\n\n output, not_available = None, []\n for method, mime_type in reversed(_MIME_METHODS.items()):\n if mime_type in format_dict:\n output = format_dict[mime_type]\n else:\n output = _eval_formatter(obj, method)\n\n if output is None:\n continue\n elif mime_type not in _MIME_RENDERERS:\n not_available.append(mime_type)\n continue\n break\n if output is None:\n if not_available:\n window.console.warn(\n f\"Rendered object requested unavailable MIME renderers: {not_available}\"\n )\n output = repr(output)\n mime_type = \"text/plain\"\n elif isinstance(output, tuple):\n output, meta = output\n else:\n meta = {}\n return _MIME_RENDERERS[mime_type](output, meta), mime_type\n\n\ndef _write(element, value, append=False):\n html, mime_type = _format_mime(value)\n if html == \"\\\\n\":\n return\n\n if append:\n out_element = document.createElement(\"div\")\n element.append(out_element)\n else:\n out_element = element.lastElementChild\n if out_element is None:\n out_element = element\n\n if mime_type in (\"application/javascript\", \"text/html\"):\n script_element = document.createRange().createContextualFragment(html)\n out_element.append(script_element)\n else:\n out_element.innerHTML = html\n\n\ndef display(*values, target=None, append=True):\n if target is None:\n target = current_target()\n\n element = document.getElementById(target)\n\n # if element is a <script type=\"py\">, it has a 'target' attribute which\n # points to the visual element holding the displayed values. In that case,\n # use that.\n if element.tagName == \"SCRIPT\" and hasattr(element, \"target\"):\n element = element.target\n\n for v in values:\n if not append:\n element.replaceChildren()\n _write(element, v, append=append)\n",
4
+ "__init__.py": "# Some notes about the naming conventions and the relationship between various\n# similar-but-different names.\n#\n# import pyscript\n# this package contains the main user-facing API offered by pyscript. All\n# the names which are supposed be used by end users should be made\n# available in pyscript/__init__.py (i.e., this file)\n#\n# import _pyscript\n# this is an internal module implemented in JS. It is used internally by\n# the pyscript package, end users should not use it directly. For its\n# implementation, grep for `interpreter.registerJsModule(\"_pyscript\",\n# ...)` in core.js\n#\n# import js\n# this is the JS globalThis, as exported by pyodide and/or micropython's\n# FFIs. As such, it contains different things in the main thread or in a\n# worker.\n#\n# import pyscript.magic_js\n# this submodule abstracts away some of the differences between the main\n# thread and the worker. In particular, it defines `window` and `document`\n# in such a way that these names work in both cases: in the main thread,\n# they are the \"real\" objects, in the worker they are proxies which work\n# thanks to coincident.\n#\n# from pyscript import window, document\n# these are just the window and document objects as defined by\n# pyscript.magic_js. This is the blessed way to access them from pyscript,\n# as it works transparently in both the main thread and worker cases.\n\nfrom pyscript.display import HTML, display\nfrom pyscript.magic_js import (\n RUNNING_IN_WORKER,\n PyWorker,\n current_target,\n document,\n sync,\n window,\n)\n\ntry:\n from pyscript.event_handling import when\nexcept:\n from pyscript.util import NotSupported\n\n when = NotSupported(\n \"pyscript.when\", \"pyscript.when currently not available with this interpreter\"\n )\n",
5
+ "display.py": "import base64\nimport html\nimport io\nimport re\n\nfrom pyscript.magic_js import current_target, document, window\n\n_MIME_METHODS = {\n \"__repr__\": \"text/plain\",\n \"_repr_html_\": \"text/html\",\n \"_repr_markdown_\": \"text/markdown\",\n \"_repr_svg_\": \"image/svg+xml\",\n \"_repr_pdf_\": \"application/pdf\",\n \"_repr_jpeg_\": \"image/jpeg\",\n \"_repr_png_\": \"image/png\",\n \"_repr_latex\": \"text/latex\",\n \"_repr_json_\": \"application/json\",\n \"_repr_javascript_\": \"application/javascript\",\n \"savefig\": \"image/png\",\n}\n\n\ndef _render_image(mime, value, meta):\n # If the image value is using bytes we should convert it to base64\n # otherwise it will return raw bytes and the browser will not be able to\n # render it.\n if isinstance(value, bytes):\n value = base64.b64encode(value).decode(\"utf-8\")\n\n # This is the pattern of base64 strings\n base64_pattern = re.compile(\n r\"^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$\"\n )\n # If value doesn't match the base64 pattern we should encode it to base64\n if len(value) > 0 and not base64_pattern.match(value):\n value = base64.b64encode(value.encode(\"utf-8\")).decode(\"utf-8\")\n\n data = f\"data:{mime};charset=utf-8;base64,{value}\"\n attrs = \" \".join(['{k}=\"{v}\"' for k, v in meta.items()])\n return f'<img src=\"{data}\" {attrs}></img>'\n\n\ndef _identity(value, meta):\n return value\n\n\n_MIME_RENDERERS = {\n \"text/plain\": html.escape,\n \"text/html\": _identity,\n \"image/png\": lambda value, meta: _render_image(\"image/png\", value, meta),\n \"image/jpeg\": lambda value, meta: _render_image(\"image/jpeg\", value, meta),\n \"image/svg+xml\": _identity,\n \"application/json\": _identity,\n \"application/javascript\": lambda value, meta: f\"<script>{value}<\\\\/script>\",\n}\n\n\nclass HTML:\n \"\"\"\n Wrap a string so that display() can render it as plain HTML\n \"\"\"\n\n def __init__(self, html):\n self._html = html\n\n def _repr_html_(self):\n return self._html\n\n\ndef _eval_formatter(obj, print_method):\n \"\"\"\n Evaluates a formatter method.\n \"\"\"\n if print_method == \"__repr__\":\n return repr(obj)\n elif hasattr(obj, print_method):\n if print_method == \"savefig\":\n buf = io.BytesIO()\n obj.savefig(buf, format=\"png\")\n buf.seek(0)\n return base64.b64encode(buf.read()).decode(\"utf-8\")\n return getattr(obj, print_method)()\n elif print_method == \"_repr_mimebundle_\":\n return {}, {}\n return None\n\n\ndef _format_mime(obj):\n \"\"\"\n Formats object using _repr_x_ methods.\n \"\"\"\n if isinstance(obj, str):\n return html.escape(obj), \"text/plain\"\n\n mimebundle = _eval_formatter(obj, \"_repr_mimebundle_\")\n if isinstance(mimebundle, tuple):\n format_dict, _ = mimebundle\n else:\n format_dict = mimebundle\n\n output, not_available = None, []\n for method, mime_type in reversed(_MIME_METHODS.items()):\n if mime_type in format_dict:\n output = format_dict[mime_type]\n else:\n output = _eval_formatter(obj, method)\n\n if output is None:\n continue\n elif mime_type not in _MIME_RENDERERS:\n not_available.append(mime_type)\n continue\n break\n if output is None:\n if not_available:\n window.console.warn(\n f\"Rendered object requested unavailable MIME renderers: {not_available}\"\n )\n output = repr(output)\n mime_type = \"text/plain\"\n elif isinstance(output, tuple):\n output, meta = output\n else:\n meta = {}\n return _MIME_RENDERERS[mime_type](output, meta), mime_type\n\n\ndef _write(element, value, append=False):\n html, mime_type = _format_mime(value)\n if html == \"\\\\n\":\n return\n\n if append:\n out_element = document.createElement(\"div\")\n element.append(out_element)\n else:\n out_element = element.lastElementChild\n if out_element is None:\n out_element = element\n\n if mime_type in (\"application/javascript\", \"text/html\"):\n script_element = document.createRange().createContextualFragment(html)\n out_element.append(script_element)\n else:\n out_element.innerHTML = html\n\n\ndef display(*values, target=None, append=True):\n if target is None:\n target = current_target()\n elif not isinstance(target, str):\n raise TypeError(f\"target must be str or None, not {target.__class__.__name__}\")\n elif target == \"\":\n raise ValueError(\"Cannot have an empty target\")\n elif target.startswith(\"#\"):\n # note: here target is str and not None!\n # align with @when behavior\n target = target[1:]\n\n element = document.getElementById(target)\n\n # If target cannot be found on the page, a ValueError is raised\n if element is None:\n raise ValueError(\n f\"Invalid selector with id={target}. Cannot be found in the page.\"\n )\n\n # if element is a <script type=\"py\">, it has a 'target' attribute which\n # points to the visual element holding the displayed values. In that case,\n # use that.\n if element.tagName == \"SCRIPT\" and hasattr(element, \"target\"):\n element = element.target\n\n for v in values:\n if not append:\n element.replaceChildren()\n _write(element, v, append=append)\n",
6
6
  "event_handling.py": "import inspect\n\nfrom pyodide.ffi.wrappers import add_event_listener\nfrom pyscript.magic_js import document\n\n\ndef when(event_type=None, selector=None):\n \"\"\"\n Decorates a function and passes py-* events to the decorated function\n The events might or not be an argument of the decorated function\n \"\"\"\n\n def decorator(func):\n if isinstance(selector, str):\n elements = document.querySelectorAll(selector)\n else:\n # TODO: This is a hack that will be removed when pyscript becomes a package\n # and we can better manage the imports without circular dependencies\n from pyweb import pydom\n\n if isinstance(selector, pydom.Element):\n elements = [selector._js]\n elif isinstance(selector, pydom.ElementCollection):\n elements = [el._js for el in selector]\n else:\n raise ValueError(\n f\"Invalid selector: {selector}. Selector must\"\n \" be a string, a pydom.Element or a pydom.ElementCollection.\"\n )\n\n sig = inspect.signature(func)\n # Function doesn't receive events\n if not sig.parameters:\n\n def wrapper(*args, **kwargs):\n func()\n\n for el in elements:\n add_event_listener(el, event_type, wrapper)\n else:\n for el in elements:\n add_event_listener(el, event_type, func)\n return func\n\n return decorator\n",
7
- "magic_js.py": "from pyscript.util import NotSupported\nimport js as globalThis\n\nRUNNING_IN_WORKER = not hasattr(globalThis, \"document\")\n\nif RUNNING_IN_WORKER:\n import polyscript\n\n PyWorker = NotSupported(\n 'pyscript.PyWorker',\n 'pyscript.PyWorker works only when running in the main thread')\n window = polyscript.xworker.window\n document = window.document\n sync = polyscript.xworker.sync\n\n # in workers the display does not have a default ID\n # but there is a sync utility from xworker\n def current_target():\n return polyscript.target\n\nelse:\n import _pyscript\n from _pyscript import PyWorker\n window = globalThis\n document = globalThis.document\n sync = NotSupported(\n 'pyscript.sync',\n 'pyscript.sync works only when running in a worker')\n\n # in MAIN the current element target exist, just use it\n def current_target():\n return _pyscript.target\n",
7
+ "magic_js.py": "import js as globalThis\nfrom pyscript.util import NotSupported\n\nRUNNING_IN_WORKER = not hasattr(globalThis, \"document\")\n\nif RUNNING_IN_WORKER:\n import polyscript\n\n PyWorker = NotSupported(\n \"pyscript.PyWorker\",\n \"pyscript.PyWorker works only when running in the main thread\",\n )\n window = polyscript.xworker.window\n document = window.document\n sync = polyscript.xworker.sync\n\n # in workers the display does not have a default ID\n # but there is a sync utility from xworker\n def current_target():\n return polyscript.target\n\nelse:\n import _pyscript\n from _pyscript import PyWorker\n\n window = globalThis\n document = globalThis.document\n sync = NotSupported(\n \"pyscript.sync\", \"pyscript.sync works only when running in a worker\"\n )\n\n # in MAIN the current element target exist, just use it\n def current_target():\n return _pyscript.target\n",
8
8
  "util.py": "class NotSupported:\n \"\"\"\n Small helper that raises exceptions if you try to get/set any attribute on\n it.\n \"\"\"\n\n def __init__(self, name, error):\n object.__setattr__(self, \"name\", name)\n object.__setattr__(self, \"error\", error)\n\n def __repr__(self):\n return f\"<NotSupported {self.name} [{self.error}]>\"\n\n def __getattr__(self, attr):\n raise AttributeError(self.error)\n\n def __setattr__(self, attr, value):\n raise AttributeError(self.error)\n\n def __call__(self, *args):\n raise TypeError(self.error)\n"
9
9
  },
10
10
  "pyweb": {
package/src/toml.js ADDED
@@ -0,0 +1,3 @@
1
+ const{SyntaxError:r,parse:t}=function(){function r(t,e,n,u){this.message=t,this.expected=e,this.found=n,this.location=u,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}return function(r,t){function e(){this.constructor=r}e.prototype=t.prototype,r.prototype=new e}(r,Error),r.buildMessage=function(r,t){var e={literal:function(r){return'"'+u(r.text)+'"'},class:function(r){var t,e="";for(t=0;t<r.parts.length;t++)e+=r.parts[t]instanceof Array?o(r.parts[t][0])+"-"+o(r.parts[t][1]):o(r.parts[t]);return"["+(r.inverted?"^":"")+e+"]"},any:function(r){return"any character"},end:function(r){return"end of input"},other:function(r){return r.description}};function n(r){return r.charCodeAt(0).toString(16).toUpperCase()}function u(r){return r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}function o(r){return r.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}return"Expected "+function(r){var t,n,u,o=new Array(r.length);for(t=0;t<r.length;t++)o[t]=(u=r[t],e[u.type](u));if(o.sort(),o.length>0){for(t=1,n=1;t<o.length;t++)o[t-1]!==o[t]&&(o[n]=o[t],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(r)+" but "+function(r){return r?'"'+u(r)+'"':"end of input"}(t)+" found."},{SyntaxError:r,parse:function(t,e){e=void 0!==e?e:{};var n,u,o,a,i,c,f,s,l,h,p={},v={Expressions:Zt},d=Zt,g=function(){return pe},A=function(r){ve=h(pe,!0,r)},C=function(r){ve=h(pe,!1,r)},b=function(r){l(ve.table,r[0]),ve.table[r[0]]=r[1]},y=Mt("Newline"),m="\n",x=jt("\n",!1),S="\r\n",F=jt("\r\n",!1),w=Mt("Whitespace"),E=/^[ \t]/,T=Ht([" ","\t"],!1,!1),D=Mt("Comment"),j="#",H=jt("#",!1),M={type:"any"},O="=",_=jt("=",!1),N=function(r,t){return[r,t.value]},Z=function(){return Tt()},I=Mt('[a-z], [A-Z], [0-9], "-", "_"'),R=/^[a-zA-Z0-9\-_]/,U=Ht([["a","z"],["A","Z"],["0","9"],"-","_"],!1,!1),z=function(r){return r.join("")},Q=Mt("DoubleQuote"),Y='"',k=jt('"',!1),B=Mt("SingleQuote"),J="'",P=jt("'",!1),V=Mt("ThreeDoubleQuotes"),W='"""',q=jt('"""',!1),G=Mt("ThreeSingleQuotes"),K="'''",L=jt("'''",!1),X=function(r){return{type:"String",value:r.join("")}},$=Mt("NormalCharacter"),rr=/^[^\0-\x1F"\\]/,tr=Ht([["\0",""],'"',"\\"],!0,!1),er="u",nr=jt("u",!1),ur="U",or=jt("U",!1),ar=function(){var r=Tt();return r.length<=2?f(r[1]):s(parseInt(r.substr(2),16))},ir=Mt('"b", "f", "n", "r", "t"'),cr=/^[bfnrt]/,fr=Ht(["b","f","n","r","t"],!1,!1),sr=Mt("Backslash"),lr="\\",hr=jt("\\",!1),pr=Mt("FourHexadecimalDigits"),vr=Mt("EightHexadecimalDigits"),dr=/^[0-9A-Fa-f]/,gr=Ht([["0","9"],["A","F"],["a","f"]],!1,!1),Ar=function(){var r=Tt();return{type:"String",value:r.substr(1,r.length-2)}},Cr=/^[^\0-\x08\n-\x1F']/,br=Ht([["\0","\b"],["\n",""],"'"],!0,!1),yr=function(){return""},mr=/^[^\0-\x1F\\]/,xr=Ht([["\0",""],"\\"],!0,!1),Sr=Mt("AnyCharacter"),Fr=/^[^\0-\x08\n-\x1F]/,wr=Ht([["\0","\b"],["\n",""]],!0,!1),Er="true",Tr=jt("true",!1),Dr=function(){return{type:"Boolean",value:!0}},jr="false",Hr=jt("false",!1),Mr=function(){return{type:"Boolean",value:!1}},Or=function(){var r=Tt(),t=parseFloat(r.replace(/_/g,""));return o(t)||Dt(r+"is not a 64-bit floating-point number."),{type:"Float",value:t}},_r=".",Nr=jt(".",!1),Zr="_",Ir=jt("_",!1),Rr="e",Ur=jt("e",!1),zr="E",Qr=jt("E",!1),Yr=function(){var r=Tt();/^[-+]?0./.test(r)&&Dt("integer must not contain leading zeros");var t=r.replace(/_/g,""),e=!1;if("-"===t[0]){var n="-9223372036854775808";(t.length>20||20===t.length&&t>n)&&(e=!0)}else{"+"===t[0]&&(t=t.substr(1));var u="9223372036854775807";(t.length>19||19===t.length&&t>u)&&(e=!0)}return e&&Dt(r+" is not a 64-bit signed integer."),t=parseInt(t,10),o(t)||Dt(r+" is not a 64-bit signed integer."),{type:"Integer",value:t}},kr="+",Br=jt("+",!1),Jr="-",Pr=jt("-",!1),Vr=/^[0-9]/,Wr=Ht([["0","9"]],!1,!1),qr="T",Gr=jt("T",!1),Kr=function(){var r=Tt(),t=new Date(r);return o(t.getTime())||Dt("Date-time "+r+" is invalid. It does not conform to RFC 3339 or this is a browser-specific problem."),{type:"DateTime",value:t}},Lr=Mt("FullDate (YYYY-mm-dd)"),Xr=":",$r=jt(":",!1),rt=Mt("Hour (HH)"),tt=Mt("Minute (MM)"),et=Mt("Second (SS)"),nt=Mt("TimeOffset (Z or +/-HH:MM)"),ut="Z",ot=jt("Z",!1),at="[",it=jt("[",!1),ct=",",ft=jt(",",!1),st="]",lt=jt("]",!1),ht=function(r){for(var t={type:"Array",value:r?r[0]:[]},e=0,n=t.value,u=n.length;e<u;e++)n[e]=n[e].value;return t},pt=function(r,t){var e=[r];if(t)for(var n=r.type,u=0,o=t[3],a=o.length;u<a;u++)n!==o[u].type&&Dt(c(o[u].value)+' should be of type "'+n+'".'),e.push(o[u]);return e},vt="{",dt=jt("{",!1),gt="}",At=jt("}",!1),Ct=function(r){var t={};if(r){t[r[0][0]]=r[0][1];for(var e=0,n=r[1],u=n.length;e<u;e++){var o=n[e][3];l(t,o[0]),t[o[0]]=o[1]}}return{type:"InlineTable",value:t}},bt=function(r){return r},yt=function(r,t){for(var e=[r],n=0,u=t.length;n<u;n++)e.push(t[n][3]);return e},mt=0,xt=0,St=[{line:1,column:1}],Ft=0,wt=[],Et=0;if("startRule"in e){if(!(e.startRule in v))throw new Error("Can't start parsing from rule \""+e.startRule+'".');d=v[e.startRule]}function Tt(){return t.substring(xt,mt)}function Dt(t,e){throw function(t,e){return new r(t,null,null,e)}(t,e=void 0!==e?e:_t(xt,mt))}function jt(r,t){return{type:"literal",text:r,ignoreCase:t}}function Ht(r,t,e){return{type:"class",parts:r,inverted:t,ignoreCase:e}}function Mt(r){return{type:"other",description:r}}function Ot(r){var e,n=St[r];if(n)return n;for(e=r-1;!St[e];)e--;for(n={line:(n=St[e]).line,column:n.column};e<r;)10===t.charCodeAt(e)?(n.line++,n.column=1):n.column++,e++;return St[r]=n,n}function _t(r,t){var e=Ot(r),n=Ot(t);return{start:{offset:r,line:e.line,column:e.column},end:{offset:t,line:n.line,column:n.column}}}function Nt(r){mt<Ft||(mt>Ft&&(Ft=mt,wt=[]),wt.push(r))}function Zt(){var r,e,n,u,o,a,i,c;for(r=mt,e=[],(n=Rt())===p&&(n=It())===p&&(n=Ut());n!==p;)e.push(n),(n=Rt())===p&&(n=It())===p&&(n=Ut());if(e!==p){if(n=mt,u=function(){var r,e;r=mt,e=function(){var r,e,n,u;r=mt,91===t.charCodeAt(mt)?(e=at,mt++):(e=p,0===Et&&Nt(it));e!==p&&(n=fe())!==p?(93===t.charCodeAt(mt)?(u=st,mt++):(u=p,0===Et&&Nt(lt)),u!==p?(xt=r,r=e=bt(n)):(mt=r,r=p)):(mt=r,r=p);return r}(),e!==p&&(xt=r,e=A(e));r=e,r===p&&(r=mt,(e=fe())!==p&&(xt=r,e=C(e)),(r=e)===p&&(r=mt,(e=zt())!==p&&(xt=r,e=b(e)),r=e));return r}(),u!==p){for(o=[],(a=Rt())===p&&(a=Ut());a!==p;)o.push(a),(a=Rt())===p&&(a=Ut());o!==p?(a=mt,(i=It())!==p&&(c=Zt())!==p?a=i=[i,c]:(mt=a,a=p),a===p&&(a=null),a!==p?n=u=[u,o,a]:(mt=n,n=p)):(mt=n,n=p)}else mt=n,n=p;n===p&&(n=null),n!==p?(xt=r,r=e=g()):(mt=r,r=p)}else mt=r,r=p;return r}function It(){var r;return Et++,10===t.charCodeAt(mt)?(r=m,mt++):(r=p,0===Et&&Nt(x)),r===p&&(t.substr(mt,2)===S?(r=S,mt+=2):(r=p,0===Et&&Nt(F))),Et--,r===p&&0===Et&&Nt(y),r}function Rt(){var r;return Et++,E.test(t.charAt(mt))?(r=t.charAt(mt),mt++):(r=p,0===Et&&Nt(T)),Et--,r===p&&0===Et&&Nt(w),r}function Ut(){var r,e,n,u,o,a;if(Et++,r=mt,35===t.charCodeAt(mt)?(e=j,mt++):(e=p,0===Et&&Nt(H)),e!==p){for(n=[],u=mt,o=mt,Et++,a=It(),Et--,a===p?o=void 0:(mt=o,o=p),o!==p?(t.length>mt?(a=t.charAt(mt),mt++):(a=p,0===Et&&Nt(M)),a!==p?u=o=[o,a]:(mt=u,u=p)):(mt=u,u=p);u!==p;)n.push(u),u=mt,o=mt,Et++,a=It(),Et--,a===p?o=void 0:(mt=o,o=p),o!==p?(t.length>mt?(a=t.charAt(mt),mt++):(a=p,0===Et&&Nt(M)),a!==p?u=o=[o,a]:(mt=u,u=p)):(mt=u,u=p);n!==p?r=e=[e,n]:(mt=r,r=p)}else mt=r,r=p;return Et--,r===p&&(e=p,0===Et&&Nt(D)),r}function zt(){var r,e,n,u,o,a;if(r=mt,(e=Qt())!==p){for(n=[],u=Rt();u!==p;)n.push(u),u=Rt();if(n!==p)if(61===t.charCodeAt(mt)?(u=O,mt++):(u=p,0===Et&&Nt(_)),u!==p){for(o=[],a=Rt();a!==p;)o.push(a),a=Rt();o!==p&&(a=Vt())!==p?(xt=r,r=e=N(e,a)):(mt=r,r=p)}else mt=r,r=p;else mt=r,r=p}else mt=r,r=p;return r}function Qt(){var r;return(r=function(){var r,t,e;if(r=mt,t=[],(e=Yt())!==p)for(;e!==p;)t.push(e),e=Yt();else t=p;t!==p&&(xt=r,t=Z());return r=t,r}())===p&&(r=function(){var r,t,e;if(r=mt,kt()!==p){if(t=[],(e=Wt())!==p)for(;e!==p;)t.push(e),e=Wt();else t=p;t!==p&&(e=kt())!==p?(xt=r,r=z(t)):(mt=r,r=p)}else mt=r,r=p;return r}()),r}function Yt(){var r;return Et++,R.test(t.charAt(mt))?(r=t.charAt(mt),mt++):(r=p,0===Et&&Nt(U)),Et--,r===p&&0===Et&&Nt(I),r}function kt(){var r;return Et++,34===t.charCodeAt(mt)?(r=Y,mt++):(r=p,0===Et&&Nt(k)),Et--,r===p&&0===Et&&Nt(Q),r}function Bt(){var r;return Et++,39===t.charCodeAt(mt)?(r=J,mt++):(r=p,0===Et&&Nt(P)),Et--,r===p&&0===Et&&Nt(B),r}function Jt(){var r;return Et++,t.substr(mt,3)===W?(r=W,mt+=3):(r=p,0===Et&&Nt(q)),Et--,r===p&&0===Et&&Nt(V),r}function Pt(){var r;return Et++,t.substr(mt,3)===K?(r=K,mt+=3):(r=p,0===Et&&Nt(L)),Et--,r===p&&0===Et&&Nt(G),r}function Vt(){var r;return(r=function(){var r;r=function(){var r,t,e,n;if(r=mt,Jt()!==p)if((t=It())===p&&(t=null),t!==p){for(e=[],n=Xt();n!==p;)e.push(n),n=Xt();e!==p&&(n=Jt())!==p?(xt=r,r=X(e)):(mt=r,r=p)}else mt=r,r=p;else mt=r,r=p;return r}(),r===p&&(r=function(){var r,t,e;if(r=mt,kt()!==p){for(t=[],e=Wt();e!==p;)t.push(e),e=Wt();t!==p&&(e=kt())!==p?(xt=r,r=X(t)):(mt=r,r=p)}else mt=r,r=p;return r}())===p&&(r=function(){var r,t,e,n;if(r=mt,Pt()!==p)if((t=It())===p&&(t=null),t!==p){for(e=[],n=$t();n!==p;)e.push(n),n=$t();e!==p&&(n=Pt())!==p?(xt=r,r=X(e)):(mt=r,r=p)}else mt=r,r=p;else mt=r,r=p;return r}())===p&&(r=function(){var r,t,e;if(r=mt,Bt()!==p){for(t=[],e=Lt();e!==p;)t.push(e),e=Lt();t!==p&&(e=Bt())!==p?(xt=r,r=Ar()):(mt=r,r=p)}else mt=r,r=p;return r}());return r}())===p&&(r=function(){var r,e;r=mt,t.substr(mt,4)===Er?(e=Er,mt+=4):(e=p,0===Et&&Nt(Tr));e!==p&&(xt=r,e=Dr());r=e,r===p&&(r=mt,t.substr(mt,5)===jr?(e=jr,mt+=5):(e=p,0===Et&&Nt(Hr)),e!==p&&(xt=r,e=Mr()),r=e);return r}())===p&&(r=function(){var r,e,n,u;r=mt,e=function(){var r,e,n,u,o,a;Et++,r=mt,e=function(){var r,t,e,n,u;r=mt,(t=ue())!==p&&(e=ue())!==p&&(n=ue())!==p&&(u=ue())!==p?r=t=[t,e,n,u]:(mt=r,r=p);return r}(),e!==p?(45===t.charCodeAt(mt)?(n=Jr,mt++):(n=p,0===Et&&Nt(Pr)),n!==p?(u=function(){var r,t,e;r=mt,t=ue(),t!==p&&(e=ue())!==p?r=t=[t,e]:(mt=r,r=p);return r}(),u!==p?(45===t.charCodeAt(mt)?(o=Jr,mt++):(o=p,0===Et&&Nt(Pr)),o!==p?(a=function(){var r,t,e;r=mt,t=ue(),t!==p&&(e=ue())!==p?r=t=[t,e]:(mt=r,r=p);return r}(),a!==p?r=e=[e,n,u,o,a]:(mt=r,r=p)):(mt=r,r=p)):(mt=r,r=p)):(mt=r,r=p)):(mt=r,r=p);Et--,r===p&&(e=p,0===Et&&Nt(Lr));return r}(),e!==p?(84===t.charCodeAt(mt)?(n=qr,mt++):(n=p,0===Et&&Nt(Gr)),n!==p?(u=function(){var r,e,n;r=mt,e=function(){var r,e,n,u,o,a,i;r=mt,e=oe(),e!==p?(58===t.charCodeAt(mt)?(n=Xr,mt++):(n=p,0===Et&&Nt($r)),n!==p&&(u=ae())!==p?(58===t.charCodeAt(mt)?(o=Xr,mt++):(o=p,0===Et&&Nt($r)),o!==p?(a=function(){var r,t,e;Et++,r=mt,t=ue(),t!==p&&(e=ue())!==p?r=t=[t,e]:(mt=r,r=p);Et--,r===p&&(t=p,0===Et&&Nt(et));return r}(),a!==p?(i=function(){var r,e,n,u;r=mt,46===t.charCodeAt(mt)?(e=_r,mt++):(e=p,0===Et&&Nt(Nr));if(e!==p){if(n=[],(u=ue())!==p)for(;u!==p;)n.push(u),u=ue();else n=p;n!==p?r=e=[e,n]:(mt=r,r=p)}else mt=r,r=p;return r}(),i===p&&(i=null),i!==p?r=e=[e,n,u,o,a,i]:(mt=r,r=p)):(mt=r,r=p)):(mt=r,r=p)):(mt=r,r=p)):(mt=r,r=p);return r}(),e!==p?(n=function(){var r,e,n,u,o;Et++,90===t.charCodeAt(mt)?(r=ut,mt++):(r=p,0===Et&&Nt(ot));r===p&&(r=mt,(e=ee())!==p&&(n=oe())!==p?(58===t.charCodeAt(mt)?(u=Xr,mt++):(u=p,0===Et&&Nt($r)),u!==p&&(o=ae())!==p?r=e=[e,n,u,o]:(mt=r,r=p)):(mt=r,r=p));Et--,r===p&&(e=p,0===Et&&Nt(nt));return r}(),n!==p?r=e=[e,n]:(mt=r,r=p)):(mt=r,r=p);return r}(),u!==p?(xt=r,r=e=Kr()):(mt=r,r=p)):(mt=r,r=p)):(mt=r,r=p);return r}())===p&&(r=function(){var r,e,n,u;r=mt,te()!==p?(e=mt,n=function(){var r,e,n,u,o,a,i;r=mt,46===t.charCodeAt(mt)?(e=_r,mt++):(e=p,0===Et&&Nt(Nr));if(e!==p)if((n=ue())!==p){for(u=[],o=mt,95===t.charCodeAt(mt)?(a=Zr,mt++):(a=p,0===Et&&Nt(Ir)),a===p&&(a=null),a!==p&&(i=ue())!==p?o=a=[a,i]:(mt=o,o=p);o!==p;)u.push(o),o=mt,95===t.charCodeAt(mt)?(a=Zr,mt++):(a=p,0===Et&&Nt(Ir)),a===p&&(a=null),a!==p&&(i=ue())!==p?o=a=[a,i]:(mt=o,o=p);u!==p?r=e=[e,n,u]:(mt=r,r=p)}else mt=r,r=p;else mt=r,r=p;return r}(),n!==p?((u=re())===p&&(u=null),u!==p?e=n=[n,u]:(mt=e,e=p)):(mt=e,e=p),e===p&&(e=re()),e!==p?(xt=r,r=Or()):(mt=r,r=p)):(mt=r,r=p);return r}())===p&&(r=te())===p&&(r=function(){var r,e,n,u,o,a,i,c,f,s;r=mt,91===t.charCodeAt(mt)?(e=at,mt++):(e=p,0===Et&&Nt(it));if(e!==p){for(n=[],u=ce();u!==p;)n.push(u),u=ce();if(n!==p){if(u=mt,(o=ie())!==p){for(a=[],i=ce();i!==p;)a.push(i),i=ce();if(a!==p){if(i=mt,44===t.charCodeAt(mt)?(c=ct,mt++):(c=p,0===Et&&Nt(ft)),c!==p){for(f=[],s=ce();s!==p;)f.push(s),s=ce();f!==p?i=c=[c,f]:(mt=i,i=p)}else mt=i,i=p;i===p&&(i=null),i!==p?u=o=[o,a,i]:(mt=u,u=p)}else mt=u,u=p}else mt=u,u=p;u===p&&(u=null),u!==p?(93===t.charCodeAt(mt)?(o=st,mt++):(o=p,0===Et&&Nt(lt)),o!==p?(xt=r,r=e=ht(u)):(mt=r,r=p)):(mt=r,r=p)}else mt=r,r=p}else mt=r,r=p;return r}())===p&&(r=function(){var r,e,n,u,o,a,i,c,f,s,l;r=mt,123===t.charCodeAt(mt)?(e=vt,mt++):(e=p,0===Et&&Nt(dt));if(e!==p){for(n=[],u=Rt();u!==p;)n.push(u),u=Rt();if(n!==p){if(u=mt,(o=zt())!==p){for(a=[],i=mt,c=[],f=Rt();f!==p;)c.push(f),f=Rt();if(c!==p)if(44===t.charCodeAt(mt)?(f=ct,mt++):(f=p,0===Et&&Nt(ft)),f!==p){for(s=[],l=Rt();l!==p;)s.push(l),l=Rt();s!==p&&(l=zt())!==p?i=c=[c,f,s,l]:(mt=i,i=p)}else mt=i,i=p;else mt=i,i=p;for(;i!==p;){for(a.push(i),i=mt,c=[],f=Rt();f!==p;)c.push(f),f=Rt();if(c!==p)if(44===t.charCodeAt(mt)?(f=ct,mt++):(f=p,0===Et&&Nt(ft)),f!==p){for(s=[],l=Rt();l!==p;)s.push(l),l=Rt();s!==p&&(l=zt())!==p?i=c=[c,f,s,l]:(mt=i,i=p)}else mt=i,i=p;else mt=i,i=p}if(a!==p){for(i=[],c=Rt();c!==p;)i.push(c),c=Rt();i!==p?u=o=[o,a,i]:(mt=u,u=p)}else mt=u,u=p}else mt=u,u=p;u===p&&(u=null),u!==p?(125===t.charCodeAt(mt)?(o=gt,mt++):(o=p,0===Et&&Nt(At)),o!==p?(xt=r,r=e=Ct(u)):(mt=r,r=p)):(mt=r,r=p)}else mt=r,r=p}else mt=r,r=p;return r}()),r}function Wt(){var r;return(r=function(){var r,e,n;Et++,r=mt,e=mt,Et++,n=It(),Et--,n===p?e=void 0:(mt=e,e=p);e!==p?(rr.test(t.charAt(mt))?(n=t.charAt(mt),mt++):(n=p,0===Et&&Nt(tr)),n!==p?(xt=r,r=e=Z()):(mt=r,r=p)):(mt=r,r=p);Et--,r===p&&(e=p,0===Et&&Nt($));return r}())===p&&(r=qt()),r}function qt(){var r,e,n,u;return r=mt,Gt()!==p?(e=function(){var r;Et++,cr.test(t.charAt(mt))?(r=t.charAt(mt),mt++):(r=p,0===Et&&Nt(fr));Et--,r===p&&0===Et&&Nt(ir);return r}(),e===p&&(e=kt())===p&&(e=Gt())===p&&(e=mt,117===t.charCodeAt(mt)?(n=er,mt++):(n=p,0===Et&&Nt(nr)),n!==p?(u=function(){var r,t,e,n,u;Et++,r=mt,t=Kt(),t!==p&&(e=Kt())!==p&&(n=Kt())!==p&&(u=Kt())!==p?r=t=[t,e,n,u]:(mt=r,r=p);Et--,r===p&&(t=p,0===Et&&Nt(pr));return r}(),u!==p?e=n=[n,u]:(mt=e,e=p)):(mt=e,e=p),e===p&&(e=mt,85===t.charCodeAt(mt)?(n=ur,mt++):(n=p,0===Et&&Nt(or)),n!==p?(u=function(){var r,t,e,n,u,o,a,i,c;Et++,r=mt,t=Kt(),t!==p&&(e=Kt())!==p&&(n=Kt())!==p&&(u=Kt())!==p&&(o=Kt())!==p&&(a=Kt())!==p&&(i=Kt())!==p&&(c=Kt())!==p?r=t=[t,e,n,u,o,a,i,c]:(mt=r,r=p);Et--,r===p&&(t=p,0===Et&&Nt(vr));return r}(),u!==p?e=n=[n,u]:(mt=e,e=p)):(mt=e,e=p))),e!==p?(xt=r,r=ar()):(mt=r,r=p)):(mt=r,r=p),r}function Gt(){var r;return Et++,92===t.charCodeAt(mt)?(r=lr,mt++):(r=p,0===Et&&Nt(hr)),Et--,r===p&&0===Et&&Nt(sr),r}function Kt(){var r;return dr.test(t.charAt(mt))?(r=t.charAt(mt),mt++):(r=p,0===Et&&Nt(gr)),r}function Lt(){var r,e,n;return Et++,r=mt,e=mt,Et++,n=It(),Et--,n===p?e=void 0:(mt=e,e=p),e!==p?(Cr.test(t.charAt(mt))?(n=t.charAt(mt),mt++):(n=p,0===Et&&Nt(br)),n!==p?r=e=[e,n]:(mt=r,r=p)):(mt=r,r=p),Et--,r===p&&(e=p,0===Et&&Nt($)),r}function Xt(){var r,e,n;if(r=function(){var r,e,n;r=mt,e=mt,Et++,n=Jt(),Et--,n===p?e=void 0:(mt=e,e=p);e!==p?(n=function(){var r,e,n;Et++,r=mt,e=mt,Et++,n=It(),Et--,n===p?e=void 0:(mt=e,e=p);e!==p?(mr.test(t.charAt(mt))?(n=t.charAt(mt),mt++):(n=p,0===Et&&Nt(xr)),n!==p?r=e=[e,n]:(mt=r,r=p)):(mt=r,r=p);Et--,r===p&&(e=p,0===Et&&Nt($));return r}(),n!==p?(xt=r,r=e=Z()):(mt=r,r=p)):(mt=r,r=p);r===p&&(r=qt());return r}(),r===p){if(r=mt,Gt()!==p)if(It()!==p){for(e=[],(n=Rt())===p&&(n=It());n!==p;)e.push(n),(n=Rt())===p&&(n=It());e!==p?(xt=r,r=yr()):(mt=r,r=p)}else mt=r,r=p;else mt=r,r=p;r===p&&(r=It())}return r}function $t(){var r,e,n;return r=mt,e=mt,Et++,t.substr(mt,3)===K?(n=K,mt+=3):(n=p,0===Et&&Nt(L)),Et--,n===p?e=void 0:(mt=e,e=p),e!==p?(n=function(){var r,e,n;Et++,r=mt,e=mt,Et++,n=It(),Et--,n===p?e=void 0:(mt=e,e=p);e!==p?(Fr.test(t.charAt(mt))?(n=t.charAt(mt),mt++):(n=p,0===Et&&Nt(wr)),n!==p?r=e=[e,n]:(mt=r,r=p)):(mt=r,r=p);Et--,r===p&&(e=p,0===Et&&Nt(Sr));return r}(),n!==p?(xt=r,r=e=Z()):(mt=r,r=p)):(mt=r,r=p),r===p&&(r=It()),r}function re(){var r,e,n,u;return r=mt,101===t.charCodeAt(mt)?(e=Rr,mt++):(e=p,0===Et&&Nt(Ur)),e===p&&(69===t.charCodeAt(mt)?(e=zr,mt++):(e=p,0===Et&&Nt(Qr))),e!==p?((n=ee())===p&&(n=null),n!==p&&(u=ne())!==p?r=e=[e,n,u]:(mt=r,r=p)):(mt=r,r=p),r}function te(){var r,t;return r=mt,(t=ee())===p&&(t=null),t!==p&&ne()!==p?(xt=r,r=t=Yr()):(mt=r,r=p),r}function ee(){var r;return 43===t.charCodeAt(mt)?(r=kr,mt++):(r=p,0===Et&&Nt(Br)),r===p&&(45===t.charCodeAt(mt)?(r=Jr,mt++):(r=p,0===Et&&Nt(Pr))),r}function ne(){var r,e,n,u,o,a;if(r=mt,(e=ue())!==p){for(n=[],u=mt,95===t.charCodeAt(mt)?(o=Zr,mt++):(o=p,0===Et&&Nt(Ir)),o===p&&(o=null),o!==p&&(a=ue())!==p?u=o=[o,a]:(mt=u,u=p);u!==p;)n.push(u),u=mt,95===t.charCodeAt(mt)?(o=Zr,mt++):(o=p,0===Et&&Nt(Ir)),o===p&&(o=null),o!==p&&(a=ue())!==p?u=o=[o,a]:(mt=u,u=p);n!==p?r=e=[e,n]:(mt=r,r=p)}else mt=r,r=p;return r}function ue(){var r;return Vr.test(t.charAt(mt))?(r=t.charAt(mt),mt++):(r=p,0===Et&&Nt(Wr)),r}function oe(){var r,t,e;return Et++,r=mt,(t=ue())!==p&&(e=ue())!==p?r=t=[t,e]:(mt=r,r=p),Et--,r===p&&(t=p,0===Et&&Nt(rt)),r}function ae(){var r,t,e;return Et++,r=mt,(t=ue())!==p&&(e=ue())!==p?r=t=[t,e]:(mt=r,r=p),Et--,r===p&&(t=p,0===Et&&Nt(tt)),r}function ie(){var r,e,n,u,o,a,i;if(r=mt,(e=Vt())!==p){for(n=mt,u=[],o=ce();o!==p;)u.push(o),o=ce();if(u!==p)if(44===t.charCodeAt(mt)?(o=ct,mt++):(o=p,0===Et&&Nt(ft)),o!==p){for(a=[],i=ce();i!==p;)a.push(i),i=ce();a!==p&&(i=ie())!==p?n=u=[u,o,a,i]:(mt=n,n=p)}else mt=n,n=p;else mt=n,n=p;n===p&&(n=null),n!==p?(xt=r,r=e=pt(e,n)):(mt=r,r=p)}else mt=r,r=p;return r}function ce(){var r;return(r=Rt())===p&&(r=It())===p&&(r=Ut()),r}function fe(){var r,e,n,u,o,a,i,c,f,s;if(r=mt,91===t.charCodeAt(mt)?(e=at,mt++):(e=p,0===Et&&Nt(it)),e!==p){for(n=[],u=Rt();u!==p;)n.push(u),u=Rt();if(n!==p)if((u=Qt())!==p){for(o=[],a=mt,i=[],c=Rt();c!==p;)i.push(c),c=Rt();if(i!==p)if(46===t.charCodeAt(mt)?(c=_r,mt++):(c=p,0===Et&&Nt(Nr)),c!==p){for(f=[],s=Rt();s!==p;)f.push(s),s=Rt();f!==p&&(s=Qt())!==p?a=i=[i,c,f,s]:(mt=a,a=p)}else mt=a,a=p;else mt=a,a=p;for(;a!==p;){for(o.push(a),a=mt,i=[],c=Rt();c!==p;)i.push(c),c=Rt();if(i!==p)if(46===t.charCodeAt(mt)?(c=_r,mt++):(c=p,0===Et&&Nt(Nr)),c!==p){for(f=[],s=Rt();s!==p;)f.push(s),s=Rt();f!==p&&(s=Qt())!==p?a=i=[i,c,f,s]:(mt=a,a=p)}else mt=a,a=p;else mt=a,a=p}if(o!==p){for(a=[],i=Rt();i!==p;)a.push(i),i=Rt();a!==p?(93===t.charCodeAt(mt)?(i=st,mt++):(i=p,0===Et&&Nt(lt)),i!==p?(xt=r,r=e=yt(u,o)):(mt=r,r=p)):(mt=r,r=p)}else mt=r,r=p}else mt=r,r=p;else mt=r,r=p}else mt=r,r=p;return r}u=function(r){return"Value for "+r+" should not be redefined in the same table."},o=Number.isFinite||function(r){return"number"==typeof r&&isFinite(r)},a=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)},i=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},c="object"==typeof JSON&&JSON?JSON.stringify:function(r){return'"'+String(r).replace(/[\x00-\x1F"\\]/g,(function(r){switch(r){case'"':case"\\":return"\\"+r;case"\t":return"\\t";case"\n":return"\\n";case"\r":return"\\r";case"\b":return"\\b";case"\f":return"\\f";default:var t=r.charCodeAt(0).toString(16);return"\\u"+"0000".substr(t.length)+t}}))+'"'},f=function(r){switch(r){case'"':case"\\":return r;case"t":return"\t";case"n":return"\n";case"r":return"\r";case"b":return"\b";case"f":return"\f";default:Dt(c(r)+" cannot be escaped.")}},s=function(r){if((!o(r)||r<0||r>1114111)&&Dt("U+"+r.toString(16)+" is not a valid Unicode code point."),String.fromCodePoint)return String.fromCodePoint(r);var t="";return r>65535&&(r-=65536,t+=String.fromCharCode(r>>>10&1023|55296),r=56320|1023&r),t+=String.fromCharCode(r)},l=function(r,t){i(r,t)&&Dt(u(c(t)))},h=function(r,t,e){for(var n="",o=0,f=e.length;o<f;o++){var s=e[o];if(n+=(n?".":"")+c(s),i(r,s))if(t)if(a(r[s]))if(Ae[n]||Dt(u(n)),o+1===f){l={};r[s].push(l),r=l}else n+="."+c(r[s].length-1),r=r[s][r[s].length-1];else de[n]||Dt(u(n)),r=r[s];else a(r[s])?(Ae[n]&&o+1!==f||Dt(u(n)),n+="."+c(r[s].length-1),r=r[s][r[s].length-1]):(de[n]||Dt(u(n)),r=r[s]);else if(t&&o+1===f){var l={};r[s]=[l],r=l,Ae[n]=!0}else r=r[s]={},de[n]=!0}return t?Ae[n]||Dt(u(n)):((ge[n]||Ae[n])&&Dt(u(n)),ge[n]=!0),{table:r,path:e}};var se,le,he,pe={},ve={table:pe,path:[]},de={},ge={},Ae={};if((n=d())!==p&&mt===t.length)return n;throw n!==p&&mt<t.length&&Nt({type:"end"}),se=wt,le=Ft<t.length?t.charAt(Ft):null,he=Ft<t.length?_t(Ft,Ft+1):_t(Ft,Ft),new r(r.buildMessage(se,le),se,le,he)}}}();
2
+ /*! (c) Jak Wings - MIT */class e extends SyntaxError{constructor(r,{offset:t,line:e,column:n}){super(r),this.offset=t,this.line=e,this.column=n}}const n=n=>{try{return t(n)}catch(t){throw t instanceof r?(t.line=t.location.start.line,t.column=t.location.start.column,t.offset=t.location.start.offset,new e(t.message,t.location.start)):t}};export{e as SyntaxError,n as parse};
3
+ //# sourceMappingURL=toml.js.map
@@ -0,0 +1,12 @@
1
+ /*! (c) Jak Wings - MIT */ declare class e extends SyntaxError {
2
+ constructor(r: any, { offset: t, line: e, column: n }: {
3
+ offset: any;
4
+ line: any;
5
+ column: any;
6
+ });
7
+ offset: any;
8
+ line: any;
9
+ column: any;
10
+ }
11
+ declare function n(n: any): any;
12
+ export { e as SyntaxError, n as parse };