kinto 18.1.0__py3-none-any.whl → 19.2.0__py3-none-any.whl
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.
Potentially problematic release.
This version of kinto might be problematic. Click here for more details.
- kinto/core/__init__.py +1 -1
- kinto/core/initialization.py +82 -53
- kinto/core/metrics.py +57 -0
- kinto/core/resource/__init__.py +6 -2
- kinto/core/statsd.py +1 -63
- kinto/core/testing.py +5 -1
- kinto/plugins/admin/build/VERSION +1 -0
- kinto/plugins/admin/build/assets/asn1-8gHclKtu.js +1 -0
- kinto/plugins/admin/build/assets/clojure-plf_rynZ.js +1 -0
- kinto/plugins/admin/build/assets/css-tpsEXL3H.js +1 -0
- kinto/plugins/admin/build/assets/index-iVTdxamX.js +175 -0
- kinto/plugins/admin/build/assets/index-vylaZGUr.css +6 -0
- kinto/plugins/admin/build/assets/javascript-upQ8KtFH.js +1 -0
- kinto/plugins/admin/build/assets/logo-FQUYikj1.png +0 -0
- kinto/plugins/admin/build/assets/mllike-ilm95jrV.js +1 -0
- kinto/plugins/admin/build/assets/python-xljIYvii.js +1 -0
- kinto/plugins/admin/build/assets/rpm-cddeyEgF.js +1 -0
- kinto/plugins/admin/build/assets/sql-3IaSLchm.js +1 -0
- kinto/plugins/admin/build/assets/ttcn-cfg-9oMIyPXS.js +1 -0
- kinto/plugins/admin/build/index.html +18 -0
- kinto/plugins/history/__init__.py +5 -6
- kinto/plugins/prometheus.py +150 -0
- kinto/plugins/quotas/__init__.py +5 -6
- kinto/plugins/statsd.py +58 -0
- {kinto-18.1.0.dist-info → kinto-19.2.0.dist-info}/METADATA +3 -2
- {kinto-18.1.0.dist-info → kinto-19.2.0.dist-info}/RECORD +30 -13
- {kinto-18.1.0.dist-info → kinto-19.2.0.dist-info}/WHEEL +1 -1
- {kinto-18.1.0.dist-info → kinto-19.2.0.dist-info}/LICENSE +0 -0
- {kinto-18.1.0.dist-info → kinto-19.2.0.dist-info}/entry_points.txt +0 -0
- {kinto-18.1.0.dist-info → kinto-19.2.0.dist-info}/top_level.txt +0 -0
kinto/core/__init__.py
CHANGED
|
@@ -66,8 +66,8 @@ DEFAULT_SETTINGS = {
|
|
|
66
66
|
"kinto.core.initialization.setup_authentication",
|
|
67
67
|
"kinto.core.initialization.setup_backoff",
|
|
68
68
|
"kinto.core.initialization.setup_sentry",
|
|
69
|
-
"kinto.core.initialization.setup_statsd",
|
|
70
69
|
"kinto.core.initialization.setup_listeners",
|
|
70
|
+
"kinto.core.initialization.setup_metrics",
|
|
71
71
|
"kinto.core.events.setup_transaction_hook",
|
|
72
72
|
),
|
|
73
73
|
"event_listeners": "",
|
kinto/core/initialization.py
CHANGED
|
@@ -21,7 +21,7 @@ from pyramid.security import NO_PERMISSION_REQUIRED
|
|
|
21
21
|
from pyramid.settings import asbool, aslist
|
|
22
22
|
from pyramid_multiauth import MultiAuthenticationPolicy, MultiAuthPolicySelected
|
|
23
23
|
|
|
24
|
-
from kinto.core import cache, errors, permission, storage, utils
|
|
24
|
+
from kinto.core import cache, errors, metrics, permission, storage, utils
|
|
25
25
|
from kinto.core.events import ACTIONS, ResourceChanged, ResourceRead
|
|
26
26
|
|
|
27
27
|
|
|
@@ -334,51 +334,13 @@ def setup_sentry(config):
|
|
|
334
334
|
|
|
335
335
|
|
|
336
336
|
def setup_statsd(config):
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
config.registry.statsd = client
|
|
346
|
-
|
|
347
|
-
client.watch_execution_time(config.registry.cache, prefix="backend")
|
|
348
|
-
client.watch_execution_time(config.registry.storage, prefix="backend")
|
|
349
|
-
client.watch_execution_time(config.registry.permission, prefix="backend")
|
|
350
|
-
|
|
351
|
-
# Commit so that configured policy can be queried.
|
|
352
|
-
config.commit()
|
|
353
|
-
policy = config.registry.queryUtility(IAuthenticationPolicy)
|
|
354
|
-
if isinstance(policy, MultiAuthenticationPolicy):
|
|
355
|
-
for name, subpolicy in policy.get_policies():
|
|
356
|
-
client.watch_execution_time(subpolicy, prefix="authentication", classname=name)
|
|
357
|
-
else:
|
|
358
|
-
client.watch_execution_time(policy, prefix="authentication")
|
|
359
|
-
|
|
360
|
-
def on_new_response(event):
|
|
361
|
-
request = event.request
|
|
362
|
-
|
|
363
|
-
# Count unique users.
|
|
364
|
-
user_id = request.prefixed_userid
|
|
365
|
-
if user_id:
|
|
366
|
-
# Get rid of colons in metric packet (see #1282).
|
|
367
|
-
user_id = user_id.replace(":", ".")
|
|
368
|
-
client.count("users", unique=user_id)
|
|
369
|
-
|
|
370
|
-
# Count authentication verifications.
|
|
371
|
-
if hasattr(request, "authn_type"):
|
|
372
|
-
client.count(f"authn_type.{request.authn_type}")
|
|
373
|
-
|
|
374
|
-
# Count view calls.
|
|
375
|
-
service = request.current_service
|
|
376
|
-
if service:
|
|
377
|
-
client.count(f"view.{service.name}.{request.method}")
|
|
378
|
-
|
|
379
|
-
config.add_subscriber(on_new_response, NewResponse)
|
|
380
|
-
|
|
381
|
-
return client
|
|
337
|
+
# It would be pretty rare to find users that have a custom ``kinto.initialization_sequence`` setting.
|
|
338
|
+
# But just in case, warn that it will be removed in next major.
|
|
339
|
+
warnings.warn(
|
|
340
|
+
"``setup_statsd()`` is now deprecated. Use ``kinto.core.initialization.setup_metrics()`` instead.",
|
|
341
|
+
DeprecationWarning,
|
|
342
|
+
)
|
|
343
|
+
setup_metrics(config)
|
|
382
344
|
|
|
383
345
|
|
|
384
346
|
def install_middlewares(app, settings):
|
|
@@ -466,6 +428,75 @@ def setup_logging(config):
|
|
|
466
428
|
config.add_subscriber(on_new_response, NewResponse)
|
|
467
429
|
|
|
468
430
|
|
|
431
|
+
def setup_metrics(config):
|
|
432
|
+
settings = config.get_settings()
|
|
433
|
+
|
|
434
|
+
# This does not fully respect the Pyramid/ZCA patterns, but the rest of Kinto uses
|
|
435
|
+
# `registry.storage`, `registry.cache`, etc. Consistency seems more important.
|
|
436
|
+
config.registry.__class__.metrics = property(
|
|
437
|
+
lambda reg: reg.queryUtility(metrics.IMetricsService)
|
|
438
|
+
)
|
|
439
|
+
|
|
440
|
+
def deprecated_registry(self):
|
|
441
|
+
warnings.warn(
|
|
442
|
+
"``config.registry.statsd`` is now deprecated. Use ``config.registry.metrics`` instead.",
|
|
443
|
+
DeprecationWarning,
|
|
444
|
+
)
|
|
445
|
+
return self.metrics
|
|
446
|
+
|
|
447
|
+
config.registry.__class__.statsd = property(deprecated_registry)
|
|
448
|
+
|
|
449
|
+
def on_app_created(event):
|
|
450
|
+
config = event.app
|
|
451
|
+
metrics_service = config.registry.metrics
|
|
452
|
+
if not metrics_service:
|
|
453
|
+
logger.warning("No metrics service registered.")
|
|
454
|
+
return
|
|
455
|
+
|
|
456
|
+
metrics.watch_execution_time(metrics_service, config.registry.cache, prefix="backend")
|
|
457
|
+
metrics.watch_execution_time(metrics_service, config.registry.storage, prefix="backend")
|
|
458
|
+
metrics.watch_execution_time(metrics_service, config.registry.permission, prefix="backend")
|
|
459
|
+
|
|
460
|
+
policy = config.registry.queryUtility(IAuthenticationPolicy)
|
|
461
|
+
if isinstance(policy, MultiAuthenticationPolicy):
|
|
462
|
+
for name, subpolicy in policy.get_policies():
|
|
463
|
+
metrics.watch_execution_time(
|
|
464
|
+
metrics_service, subpolicy, prefix="authentication", classname=name
|
|
465
|
+
)
|
|
466
|
+
else:
|
|
467
|
+
metrics.watch_execution_time(metrics_service, policy, prefix="authentication")
|
|
468
|
+
|
|
469
|
+
config.add_subscriber(on_app_created, ApplicationCreated)
|
|
470
|
+
|
|
471
|
+
def on_new_response(event):
|
|
472
|
+
request = event.request
|
|
473
|
+
metrics_service = config.registry.metrics
|
|
474
|
+
if not metrics_service:
|
|
475
|
+
return
|
|
476
|
+
|
|
477
|
+
# Count unique users.
|
|
478
|
+
user_id = request.prefixed_userid
|
|
479
|
+
if user_id:
|
|
480
|
+
# Get rid of colons in metric packet (see #1282).
|
|
481
|
+
user_id = user_id.replace(":", ".")
|
|
482
|
+
metrics_service.count("users", unique=user_id)
|
|
483
|
+
|
|
484
|
+
# Count authentication verifications.
|
|
485
|
+
if hasattr(request, "authn_type"):
|
|
486
|
+
metrics_service.count(f"authn_type.{request.authn_type}")
|
|
487
|
+
|
|
488
|
+
# Count view calls.
|
|
489
|
+
service = request.current_service
|
|
490
|
+
if service:
|
|
491
|
+
metrics_service.count(f"view.{service.name}.{request.method}")
|
|
492
|
+
|
|
493
|
+
config.add_subscriber(on_new_response, NewResponse)
|
|
494
|
+
|
|
495
|
+
# While statsd is deprecated, we include its plugin by default for retro-compability.
|
|
496
|
+
if settings["statsd_url"]:
|
|
497
|
+
config.include("kinto.plugins.statsd")
|
|
498
|
+
|
|
499
|
+
|
|
469
500
|
class EventActionFilter:
|
|
470
501
|
def __init__(self, actions, config):
|
|
471
502
|
actions = ACTIONS.from_string_list(actions)
|
|
@@ -518,11 +549,9 @@ def setup_listeners(config):
|
|
|
518
549
|
listener_mod = config.maybe_dotted(module_value)
|
|
519
550
|
listener = listener_mod.load_from_config(config, prefix)
|
|
520
551
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
key = f"listeners.{name}"
|
|
525
|
-
listener = statsd_client.timer(key)(listener.__call__)
|
|
552
|
+
wrapped_listener = metrics.listener_with_timer(
|
|
553
|
+
config, f"listeners.{name}", listener.__call__
|
|
554
|
+
)
|
|
526
555
|
|
|
527
556
|
# Optional filter by event action.
|
|
528
557
|
actions_setting = prefix + "actions"
|
|
@@ -548,11 +577,11 @@ def setup_listeners(config):
|
|
|
548
577
|
options = dict(for_actions=actions, for_resources=resource_names)
|
|
549
578
|
|
|
550
579
|
if ACTIONS.READ in actions:
|
|
551
|
-
config.add_subscriber(
|
|
580
|
+
config.add_subscriber(wrapped_listener, ResourceRead, **options)
|
|
552
581
|
actions = [a for a in actions if a != ACTIONS.READ]
|
|
553
582
|
|
|
554
583
|
if len(actions) > 0:
|
|
555
|
-
config.add_subscriber(
|
|
584
|
+
config.add_subscriber(wrapped_listener, ResourceChanged, **options)
|
|
556
585
|
|
|
557
586
|
|
|
558
587
|
def load_default_settings(config, default_settings):
|
kinto/core/metrics.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import types
|
|
2
|
+
|
|
3
|
+
from zope.interface import Interface
|
|
4
|
+
|
|
5
|
+
from kinto.core import utils
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class IMetricsService(Interface):
|
|
9
|
+
"""
|
|
10
|
+
An interface that defines the metrics service contract.
|
|
11
|
+
Any class implementing this must provide all its methods.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def timer(key):
|
|
15
|
+
"""
|
|
16
|
+
Watch execution time.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def count(key, count=1, unique=None):
|
|
20
|
+
"""
|
|
21
|
+
Count occurrences. If `unique` is set, overwrites the counter value
|
|
22
|
+
on each call.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def watch_execution_time(metrics_service, obj, prefix="", classname=None):
|
|
27
|
+
"""
|
|
28
|
+
Decorate all methods of an object in order to watch their execution time.
|
|
29
|
+
Metrics will be named `{prefix}.{classname}.{method}`.
|
|
30
|
+
"""
|
|
31
|
+
classname = classname or utils.classname(obj)
|
|
32
|
+
members = dir(obj)
|
|
33
|
+
for name in members:
|
|
34
|
+
value = getattr(obj, name)
|
|
35
|
+
is_method = isinstance(value, types.MethodType)
|
|
36
|
+
if not name.startswith("_") and is_method:
|
|
37
|
+
statsd_key = f"{prefix}.{classname}.{name}"
|
|
38
|
+
decorated_method = metrics_service.timer(statsd_key)(value)
|
|
39
|
+
setattr(obj, name, decorated_method)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def listener_with_timer(config, key, func):
|
|
43
|
+
"""
|
|
44
|
+
Add a timer with the specified `key` on the specified `func`.
|
|
45
|
+
This is used to avoid evaluating `config.registry.metrics` during setup time
|
|
46
|
+
to avoid having to deal with initialization order and configuration committing.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
def wrapped(*args, **kwargs):
|
|
50
|
+
metrics_service = config.registry.metrics
|
|
51
|
+
if not metrics_service:
|
|
52
|
+
return func(*args, **kwargs)
|
|
53
|
+
# If metrics are enabled, monitor execution time of listeners.
|
|
54
|
+
with metrics_service.timer(key):
|
|
55
|
+
return func(*args, **kwargs)
|
|
56
|
+
|
|
57
|
+
return wrapped
|
kinto/core/resource/__init__.py
CHANGED
|
@@ -1058,6 +1058,10 @@ class Resource:
|
|
|
1058
1058
|
|
|
1059
1059
|
def _extract_filters(self):
|
|
1060
1060
|
"""Extracts filters from QueryString parameters."""
|
|
1061
|
+
|
|
1062
|
+
def is_valid_timestamp(value):
|
|
1063
|
+
return isinstance(value, int) or re.match(r'^"?\d+"?$', str(value))
|
|
1064
|
+
|
|
1061
1065
|
queryparams = self.request.validated["querystring"]
|
|
1062
1066
|
|
|
1063
1067
|
filters = []
|
|
@@ -1090,7 +1094,7 @@ class Resource:
|
|
|
1090
1094
|
send_alert(self.request, message, url)
|
|
1091
1095
|
operator = COMPARISON.LT
|
|
1092
1096
|
|
|
1093
|
-
if value
|
|
1097
|
+
if value is not None and not is_valid_timestamp(value):
|
|
1094
1098
|
raise_invalid(self.request, **error_details)
|
|
1095
1099
|
|
|
1096
1100
|
filters.append(Filter(self.model.modified_field, value, operator))
|
|
@@ -1127,7 +1131,7 @@ class Resource:
|
|
|
1127
1131
|
error_details["description"] = "Invalid character 0x00"
|
|
1128
1132
|
raise_invalid(self.request, **error_details)
|
|
1129
1133
|
|
|
1130
|
-
if field == self.model.modified_field and value
|
|
1134
|
+
if field == self.model.modified_field and not is_valid_timestamp(value):
|
|
1131
1135
|
raise_invalid(self.request, **error_details)
|
|
1132
1136
|
|
|
1133
1137
|
filters.append(Filter(field, value, operator))
|
kinto/core/statsd.py
CHANGED
|
@@ -1,63 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
from urllib.parse import urlparse
|
|
3
|
-
|
|
4
|
-
from pyramid.exceptions import ConfigurationError
|
|
5
|
-
|
|
6
|
-
from kinto.core import utils
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
try:
|
|
10
|
-
import statsd as statsd_module
|
|
11
|
-
except ImportError: # pragma: no cover
|
|
12
|
-
statsd_module = None
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class Client:
|
|
16
|
-
def __init__(self, host, port, prefix):
|
|
17
|
-
self._client = statsd_module.StatsClient(host, port, prefix=prefix)
|
|
18
|
-
|
|
19
|
-
def watch_execution_time(self, obj, prefix="", classname=None):
|
|
20
|
-
classname = classname or utils.classname(obj)
|
|
21
|
-
members = dir(obj)
|
|
22
|
-
for name in members:
|
|
23
|
-
value = getattr(obj, name)
|
|
24
|
-
is_method = isinstance(value, types.MethodType)
|
|
25
|
-
if not name.startswith("_") and is_method:
|
|
26
|
-
statsd_key = f"{prefix}.{classname}.{name}"
|
|
27
|
-
decorated_method = self.timer(statsd_key)(value)
|
|
28
|
-
setattr(obj, name, decorated_method)
|
|
29
|
-
|
|
30
|
-
def timer(self, key):
|
|
31
|
-
return self._client.timer(key)
|
|
32
|
-
|
|
33
|
-
def count(self, key, count=1, unique=None):
|
|
34
|
-
if unique is None:
|
|
35
|
-
return self._client.incr(key, count=count)
|
|
36
|
-
else:
|
|
37
|
-
return self._client.set(key, unique)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def statsd_count(request, count_key):
|
|
41
|
-
statsd = request.registry.statsd
|
|
42
|
-
if statsd:
|
|
43
|
-
statsd.count(count_key)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def load_from_config(config):
|
|
47
|
-
# If this is called, it means that a ``statsd_url`` was specified in settings.
|
|
48
|
-
# (see ``kinto.core.initialization``)
|
|
49
|
-
# Raise a proper error if the ``statsd`` module is not installed.
|
|
50
|
-
if statsd_module is None:
|
|
51
|
-
error_msg = "Please install Kinto with monitoring dependencies (e.g. statsd package)"
|
|
52
|
-
raise ConfigurationError(error_msg)
|
|
53
|
-
|
|
54
|
-
settings = config.get_settings()
|
|
55
|
-
uri = settings["statsd_url"]
|
|
56
|
-
uri = urlparse(uri)
|
|
57
|
-
|
|
58
|
-
if settings["project_name"] != "":
|
|
59
|
-
prefix = settings["project_name"]
|
|
60
|
-
else:
|
|
61
|
-
prefix = settings["statsd_prefix"]
|
|
62
|
-
|
|
63
|
-
return Client(uri.hostname, uri.port, prefix)
|
|
1
|
+
from kinto.plugins.statsd import load_from_config # noqa: F401
|
kinto/core/testing.py
CHANGED
|
@@ -8,15 +8,19 @@ import webtest
|
|
|
8
8
|
from cornice import errors as cornice_errors
|
|
9
9
|
from pyramid.url import parse_url_overrides
|
|
10
10
|
|
|
11
|
-
from kinto.core import DEFAULT_SETTINGS
|
|
11
|
+
from kinto.core import DEFAULT_SETTINGS
|
|
12
12
|
from kinto.core.storage import generators
|
|
13
13
|
from kinto.core.utils import encode64, follow_subrequest, memcache, sqlalchemy
|
|
14
|
+
from kinto.plugins import prometheus, statsd
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
skip_if_ci = unittest.skipIf("CI" in os.environ, "ci")
|
|
17
18
|
skip_if_no_postgresql = unittest.skipIf(sqlalchemy is None, "postgresql is not installed.")
|
|
18
19
|
skip_if_no_memcached = unittest.skipIf(memcache is None, "memcached is not installed.")
|
|
19
20
|
skip_if_no_statsd = unittest.skipIf(not statsd.statsd_module, "statsd is not installed.")
|
|
21
|
+
skip_if_no_prometheus = unittest.skipIf(
|
|
22
|
+
not prometheus.prometheus_module, "prometheus is not installed."
|
|
23
|
+
)
|
|
20
24
|
|
|
21
25
|
|
|
22
26
|
class DummyRequest(mock.MagicMock):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.0.3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function u(i){for(var s={},c=i.split(" "),T=0;T<c.length;++T)s[c[T]]=!0;return s}const o={keywords:u("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS MINACCESS MAXACCESS REVISION STATUS DESCRIPTION SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY IMPLIED EXPORTS"),cmipVerbs:u("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"),compareTypes:u("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL TEXTUAL-CONVENTION"),status:u("current deprecated mandatory obsolete"),tags:u("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS UNIVERSAL"),storage:u("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING UTCTime InterfaceIndex IANAifType CMIP-Attribute REAL PACKAGE PACKAGES IpAddress PhysAddress NetworkAddress BITS BMPString TimeStamp TimeTicks TruthValue RowStatus DisplayString GeneralString GraphicString IA5String NumericString PrintableString SnmpAdminString TeletexString UTF8String VideotexString VisibleString StringStore ISO646String T61String UniversalString Unsigned32 Integer32 Gauge Gauge32 Counter Counter32 Counter64"),modifier:u("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS DEFINED"),accessTypes:u("not-accessible accessible-for-notify read-only read-create read-write"),multiLineStrings:!0};function L(i){var s=i.keywords||o.keywords,c=i.cmipVerbs||o.cmipVerbs,T=i.compareTypes||o.compareTypes,N=i.status||o.status,d=i.tags||o.tags,f=i.storage||o.storage,m=i.modifier||o.modifier,C=i.accessTypes||o.accessTypes,R=i.multiLineStrings||o.multiLineStrings,y=i.indentStatements!==!1,A=/[\|\^]/,E;function D(e,n){var t=e.next();if(t=='"'||t=="'")return n.tokenize=g(t),n.tokenize(e,n);if(/[\[\]\(\){}:=,;]/.test(t))return E=t,"punctuation";if(t=="-"&&e.eat("-"))return e.skipToEnd(),"comment";if(/\d/.test(t))return e.eatWhile(/[\w\.]/),"number";if(A.test(t))return e.eatWhile(A),"operator";e.eatWhile(/[\w\-]/);var r=e.current();return s.propertyIsEnumerable(r)?"keyword":c.propertyIsEnumerable(r)?"variableName":T.propertyIsEnumerable(r)?"atom":N.propertyIsEnumerable(r)?"comment":d.propertyIsEnumerable(r)?"typeName":f.propertyIsEnumerable(r)||m.propertyIsEnumerable(r)||C.propertyIsEnumerable(r)?"modifier":"variableName"}function g(e){return function(n,t){for(var r=!1,l,O=!1;(l=n.next())!=null;){if(l==e&&!r){var I=n.peek();I&&(I=I.toLowerCase(),(I=="b"||I=="h"||I=="o")&&n.next()),O=!0;break}r=!r&&l=="\\"}return(O||!(r||R))&&(t.tokenize=null),"string"}}function p(e,n,t,r,l){this.indented=e,this.column=n,this.type=t,this.align=r,this.prev=l}function a(e,n,t){var r=e.indented;return e.context&&e.context.type=="statement"&&(r=e.context.indented),e.context=new p(r,n,t,null,e.context)}function S(e){var n=e.context.type;return(n==")"||n=="]"||n=="}")&&(e.indented=e.context.indented),e.context=e.context.prev}return{name:"asn1",startState:function(){return{tokenize:null,context:new p(-2,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,n){var t=n.context;if(e.sol()&&(t.align==null&&(t.align=!1),n.indented=e.indentation(),n.startOfLine=!0),e.eatSpace())return null;E=null;var r=(n.tokenize||D)(e,n);if(r=="comment")return r;if(t.align==null&&(t.align=!0),(E==";"||E==":"||E==",")&&t.type=="statement")S(n);else if(E=="{")a(n,e.column(),"}");else if(E=="[")a(n,e.column(),"]");else if(E=="(")a(n,e.column(),")");else if(E=="}"){for(;t.type=="statement";)t=S(n);for(t.type=="}"&&(t=S(n));t.type=="statement";)t=S(n)}else E==t.type?S(n):y&&((t.type=="}"||t.type=="top")&&E!=";"||t.type=="statement"&&E=="newstatement")&&a(n,e.column(),"statement");return n.startOfLine=!1,r},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:"--"}}}}export{L as asn1};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=["false","nil","true"],l=[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],u=["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"],p=["->","->>","as->","binding","bound-fn","case","catch","comment","cond","cond->","cond->>","condp","def","definterface","defmethod","defn","defmacro","defprotocol","defrecord","defstruct","deftype","do","doseq","dotimes","doto","extend","extend-protocol","extend-type","fn","for","future","if","if-let","if-not","if-some","let","letfn","locking","loop","ns","proxy","reify","struct-map","some->","some->>","try","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn"],f=o(d),m=o(l),h=o(u),y=o(p),b=/^(?:[\\\[\]\s"(),;@^`{}~]|$)/,v=/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,g=/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,k=/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~.][^\\\[\]\s"(),;@^`{}~.\/]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/;function s(t,e){if(t.eatSpace()||t.eat(","))return["space",null];if(t.match(v))return[null,"number"];if(t.match(g))return[null,"string.special"];if(t.eat(/^"/))return(e.tokenize=x)(t,e);if(t.eat(/^[(\[{]/))return["open","bracket"];if(t.eat(/^[)\]}]/))return["close","bracket"];if(t.eat(/^;/))return t.skipToEnd(),["space","comment"];if(t.eat(/^[#'@^`~]/))return[null,"meta"];var r=t.match(k),n=r&&r[0];return n?n==="comment"&&e.lastToken==="("?(e.tokenize=w)(t,e):a(n,f)||n.charAt(0)===":"?["symbol","atom"]:a(n,m)||a(n,h)?["symbol","keyword"]:e.lastToken==="("?["symbol","builtin"]:["symbol","variable"]:(t.next(),t.eatWhile(function(i){return!a(i,b)}),[null,"error"])}function x(t,e){for(var r=!1,n;n=t.next();){if(n==='"'&&!r){e.tokenize=s;break}r=!r&&n==="\\"}return[null,"string"]}function w(t,e){for(var r=1,n;n=t.next();)if(n===")"&&r--,n==="("&&r++,r===0){t.backUp(1),e.tokenize=s;break}return["space","comment"]}function o(t){for(var e={},r=0;r<t.length;++r)e[t[r]]=!0;return e}function a(t,e){if(e instanceof RegExp)return e.test(t);if(e instanceof Object)return e.propertyIsEnumerable(t)}const q={name:"clojure",startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastToken:null,tokenize:s}},token:function(t,e){t.sol()&&typeof e.ctx.indentTo!="number"&&(e.ctx.indentTo=e.ctx.start+1);var r=e.tokenize(t,e),n=r[0],i=r[1],c=t.current();return n!=="space"&&(e.lastToken==="("&&e.ctx.indentTo===null?n==="symbol"&&a(c,y)?e.ctx.indentTo=e.ctx.start+t.indentUnit:e.ctx.indentTo="next":e.ctx.indentTo==="next"&&(e.ctx.indentTo=t.column()),e.lastToken=c),n==="open"?e.ctx={prev:e.ctx,start:t.column(),indentTo:null}:n==="close"&&(e.ctx=e.ctx.prev||e.ctx),i},indent:function(t){var e=t.ctx.indentTo;return typeof e=="number"?e:t.ctx.start+1},languageData:{closeBrackets:{brackets:["(","[","{",'"']},commentTokens:{line:";;"},autocomplete:[].concat(d,l,u)}};export{q as clojure};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function y(i){i={...ae,...i};var l=i.inline,m=i.tokenHooks,b=i.documentTypes||{},G=i.mediaTypes||{},J=i.mediaFeatures||{},Q=i.mediaValueKeywords||{},O=i.propertyKeywords||{},F=i.nonStandardPropertyKeywords||{},R=i.fontProperties||{},ee=i.counterDescriptors||{},N=i.colorKeywords||{},V=i.valueKeywords||{},g=i.allowNested,re=i.lineComment,oe=i.supportsAtComponent===!0,W=i.highlightNonStandardPropertyKeywords!==!1,w,n;function c(e,o){return w=o,e}function ie(e,o){var r=e.next();if(m[r]){var t=m[r](e,o);if(t!==!1)return t}if(r=="@")return e.eatWhile(/[\w\\\-]/),c("def",e.current());if(r=="="||(r=="~"||r=="|")&&e.eat("="))return c(null,"compare");if(r=='"'||r=="'")return o.tokenize=$(r),o.tokenize(e,o);if(r=="#")return e.eatWhile(/[\w\\\-]/),c("atom","hash");if(r=="!")return e.match(/^\s*\w*/),c("keyword","important");if(/\d/.test(r)||r=="."&&e.eat(/\d/))return e.eatWhile(/[\w.%]/),c("number","unit");if(r==="-"){if(/[\d.]/.test(e.peek()))return e.eatWhile(/[\w.%]/),c("number","unit");if(e.match(/^-[\w\\\-]*/))return e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?c("def","variable-definition"):c("variableName","variable");if(e.match(/^\w+-/))return c("meta","meta")}else return/[,+>*\/]/.test(r)?c(null,"select-op"):r=="."&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?c("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?c(null,r):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(o.tokenize=te),c("variableName.function","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),c("property","word")):c(null,null)}function $(e){return function(o,r){for(var t=!1,d;(d=o.next())!=null;){if(d==e&&!t){e==")"&&o.backUp(1);break}t=!t&&d=="\\"}return(d==e||!t&&e!=")")&&(r.tokenize=null),c("string","string")}}function te(e,o){return e.next(),e.match(/^\s*[\"\')]/,!1)?o.tokenize=null:o.tokenize=$(")"),c(null,"(")}function D(e,o,r){this.type=e,this.indent=o,this.prev=r}function s(e,o,r,t){return e.context=new D(r,o.indentation()+(t===!1?0:o.indentUnit),e.context),r}function u(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function k(e,o,r){return a[r.context.type](e,o,r)}function h(e,o,r,t){for(var d=t||1;d>0;d--)r.context=r.context.prev;return k(e,o,r)}function L(e){var o=e.current().toLowerCase();V.hasOwnProperty(o)?n="atom":N.hasOwnProperty(o)?n="keyword":n="variable"}var a={};return a.top=function(e,o,r){if(e=="{")return s(r,o,"block");if(e=="}"&&r.context.prev)return u(r);if(oe&&/@component/i.test(e))return s(r,o,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return s(r,o,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return s(r,o,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&e.charAt(0)=="@")return s(r,o,"at");if(e=="hash")n="builtin";else if(e=="word")n="tag";else{if(e=="variable-definition")return"maybeprop";if(e=="interpolation")return s(r,o,"interpolation");if(e==":")return"pseudo";if(g&&e=="(")return s(r,o,"parens")}return r.context.type},a.block=function(e,o,r){if(e=="word"){var t=o.current().toLowerCase();return O.hasOwnProperty(t)?(n="property","maybeprop"):F.hasOwnProperty(t)?(n=W?"string.special":"property","maybeprop"):g?(n=o.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(n="error","maybeprop")}else return e=="meta"?"block":!g&&(e=="hash"||e=="qualifier")?(n="error","block"):a.top(e,o,r)},a.maybeprop=function(e,o,r){return e==":"?s(r,o,"prop"):k(e,o,r)},a.prop=function(e,o,r){if(e==";")return u(r);if(e=="{"&&g)return s(r,o,"propBlock");if(e=="}"||e=="{")return h(e,o,r);if(e=="(")return s(r,o,"parens");if(e=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(o.current()))n="error";else if(e=="word")L(o);else if(e=="interpolation")return s(r,o,"interpolation");return"prop"},a.propBlock=function(e,o,r){return e=="}"?u(r):e=="word"?(n="property","maybeprop"):r.context.type},a.parens=function(e,o,r){return e=="{"||e=="}"?h(e,o,r):e==")"?u(r):e=="("?s(r,o,"parens"):e=="interpolation"?s(r,o,"interpolation"):(e=="word"&&L(o),"parens")},a.pseudo=function(e,o,r){return e=="meta"?"pseudo":e=="word"?(n="variableName.constant",r.context.type):k(e,o,r)},a.documentTypes=function(e,o,r){return e=="word"&&b.hasOwnProperty(o.current())?(n="tag",r.context.type):a.atBlock(e,o,r)},a.atBlock=function(e,o,r){if(e=="(")return s(r,o,"atBlock_parens");if(e=="}"||e==";")return h(e,o,r);if(e=="{")return u(r)&&s(r,o,g?"block":"top");if(e=="interpolation")return s(r,o,"interpolation");if(e=="word"){var t=o.current().toLowerCase();t=="only"||t=="not"||t=="and"||t=="or"?n="keyword":G.hasOwnProperty(t)?n="attribute":J.hasOwnProperty(t)?n="property":Q.hasOwnProperty(t)?n="keyword":O.hasOwnProperty(t)?n="property":F.hasOwnProperty(t)?n=W?"string.special":"property":V.hasOwnProperty(t)?n="atom":N.hasOwnProperty(t)?n="keyword":n="error"}return r.context.type},a.atComponentBlock=function(e,o,r){return e=="}"?h(e,o,r):e=="{"?u(r)&&s(r,o,g?"block":"top",!1):(e=="word"&&(n="error"),r.context.type)},a.atBlock_parens=function(e,o,r){return e==")"?u(r):e=="{"||e=="}"?h(e,o,r,2):a.atBlock(e,o,r)},a.restricted_atBlock_before=function(e,o,r){return e=="{"?s(r,o,"restricted_atBlock"):e=="word"&&r.stateArg=="@counter-style"?(n="variable","restricted_atBlock_before"):k(e,o,r)},a.restricted_atBlock=function(e,o,r){return e=="}"?(r.stateArg=null,u(r)):e=="word"?(r.stateArg=="@font-face"&&!R.hasOwnProperty(o.current().toLowerCase())||r.stateArg=="@counter-style"&&!ee.hasOwnProperty(o.current().toLowerCase())?n="error":n="property","maybeprop"):"restricted_atBlock"},a.keyframes=function(e,o,r){return e=="word"?(n="variable","keyframes"):e=="{"?s(r,o,"top"):k(e,o,r)},a.at=function(e,o,r){return e==";"?u(r):e=="{"||e=="}"?h(e,o,r):(e=="word"?n="tag":e=="hash"&&(n="builtin"),"at")},a.interpolation=function(e,o,r){return e=="}"?u(r):e=="{"||e==";"?h(e,o,r):(e=="word"?n="variable":e!="variable"&&e!="("&&e!=")"&&(n="error"),"interpolation")},{name:i.name,startState:function(){return{tokenize:null,state:l?"block":"top",stateArg:null,context:new D(l?"block":"top",0,null)}},token:function(e,o){if(!o.tokenize&&e.eatSpace())return null;var r=(o.tokenize||ie)(e,o);return r&&typeof r=="object"&&(w=r[1],r=r[0]),n=r,w!="comment"&&(o.state=a[o.state](w,e,o)),n},indent:function(e,o,r){var t=e.context,d=o&&o.charAt(0),q=t.indent;return t.type=="prop"&&(d=="}"||d==")")&&(t=t.prev),t.prev&&(d=="}"&&(t.type=="block"||t.type=="top"||t.type=="interpolation"||t.type=="restricted_atBlock")?(t=t.prev,q=t.indent):(d==")"&&(t.type=="parens"||t.type=="atBlock_parens")||d=="{"&&(t.type=="at"||t.type=="atBlock"))&&(q=Math.max(0,t.indent-r.unit))),q},languageData:{indentOnInput:/^\s*\}$/,commentTokens:{line:re,block:{open:"/*",close:"*/"}},autocomplete:M}}}function p(i){for(var l={},m=0;m<i.length;++m)l[i[m].toLowerCase()]=!0;return l}var H=["domain","regexp","url","url-prefix"],C=p(H),X=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],v=p(X),Y=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],x=p(Y),E=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],B=p(E),S=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],z=p(S),Z=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],K=p(Z),U=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],P=p(U),ne=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],I=p(ne),T=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],_=p(T),A=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],j=p(A),M=H.concat(X).concat(Y).concat(E).concat(S).concat(Z).concat(T).concat(A);const le={properties:S,colors:T,fonts:U,values:A,all:M},ae={documentTypes:C,mediaTypes:v,mediaFeatures:x,mediaValueKeywords:B,propertyKeywords:z,nonStandardPropertyKeywords:K,fontProperties:P,counterDescriptors:I,colorKeywords:_,valueKeywords:j,tokenHooks:{"/":function(i,l){return i.eat("*")?(l.tokenize=f,f(i,l)):!1}}},se=y({name:"css"});function f(i,l){for(var m=!1,b;(b=i.next())!=null;){if(m&&b=="/"){l.tokenize=null;break}m=b=="*"}return["comment","comment"]}const ce=y({name:"scss",mediaTypes:v,mediaFeatures:x,mediaValueKeywords:B,propertyKeywords:z,nonStandardPropertyKeywords:K,colorKeywords:_,valueKeywords:j,fontProperties:P,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(i,l){return i.eat("/")?(i.skipToEnd(),["comment","comment"]):i.eat("*")?(l.tokenize=f,f(i,l)):["operator","operator"]},":":function(i){return i.match(/^\s*\{/,!1)?[null,null]:!1},$:function(i){return i.match(/^[\w-]+/),i.match(/^\s*:/,!1)?["def","variable-definition"]:["variableName.special","variable"]},"#":function(i){return i.eat("{")?[null,"interpolation"]:!1}}}),de=y({name:"less",mediaTypes:v,mediaFeatures:x,mediaValueKeywords:B,propertyKeywords:z,nonStandardPropertyKeywords:K,colorKeywords:_,valueKeywords:j,fontProperties:P,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(i,l){return i.eat("/")?(i.skipToEnd(),["comment","comment"]):i.eat("*")?(l.tokenize=f,f(i,l)):["operator","operator"]},"@":function(i){return i.eat("{")?[null,"interpolation"]:i.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)?!1:(i.eatWhile(/[\w\\\-]/),i.match(/^\s*:/,!1)?["def","variable-definition"]:["variableName","variable"])},"&":function(){return["atom","atom"]}}}),ue=y({name:"gss",documentTypes:C,mediaTypes:v,mediaFeatures:x,propertyKeywords:z,nonStandardPropertyKeywords:K,fontProperties:P,counterDescriptors:I,colorKeywords:_,valueKeywords:j,supportsAtComponent:!0,tokenHooks:{"/":function(i,l){return i.eat("*")?(l.tokenize=f,f(i,l)):!1}}});export{se as css,ue as gss,le as keywords,de as less,y as mkCSS,ce as sCSS};
|