function words(e){for(var t={},n=e.split(" "),r=0;r<n.length;++r)t[n[r]]=!0;return t}const defaults={keywords:words("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:words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"),compareTypes:words("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:words("current deprecated mandatory obsolete"),tags:words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS UNIVERSAL"),storage:words("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:words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS DEFINED"),accessTypes:words("not-accessible accessible-for-notify read-only read-create read-write"),multiLineStrings:!0};function asn1(e){var t,n=e.keywords||defaults.keywords,r=e.cmipVerbs||defaults.cmipVerbs,i=e.compareTypes||defaults.compareTypes,s=e.status||defaults.status,a=e.tags||defaults.tags,E=e.storage||defaults.storage,o=e.modifier||defaults.modifier,I=e.accessTypes||defaults.accessTypes,T=e.multiLineStrings||defaults.multiLineStrings,u=!1!==e.indentStatements,S=/[\|\^]/;function l(e,u){var l,d=e.next();if('"'==d||"'"==d)return u.tokenize=(l=d,function(e,t){for(var n,r=!1,i=!1;null!=(n=e.next());){if(n==l&&!r){var s=e.peek();s&&("b"!=(s=s.toLowerCase())&&"h"!=s&&"o"!=s||e.next()),i=!0;break}r=!r&&"\\"==n;}return (i||!r&&!T)&&(t.tokenize=null),"string"}),u.tokenize(e,u);if(/[\[\]\(\){}:=,;]/.test(d))return t=d,"punctuation";if("-"==d&&e.eat("-"))return e.skipToEnd(),"comment";if(/\d/.test(d))return e.eatWhile(/[\w\.]/),"number";if(S.test(d))return e.eatWhile(S),"operator";e.eatWhile(/[\w\-]/);var A=e.current();return n.propertyIsEnumerable(A)?"keyword":r.propertyIsEnumerable(A)?"variableName":i.propertyIsEnumerable(A)?"atom":s.propertyIsEnumerable(A)?"comment":a.propertyIsEnumerable(A)?"typeName":E.propertyIsEnumerable(A)||o.propertyIsEnumerable(A)||I.propertyIsEnumerable(A)?"modifier":"variableName"}function d(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i;}function A(e,t,n){var r=e.indented;return e.context&&"statement"==e.context.type&&(r=e.context.indented),e.context=new d(r,t,n,null,e.context)}function N(e){var t=e.context.type;return ")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}return {startState:function(){return {tokenize:null,context:new d(-2,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,n){var r=n.context;if(e.sol()&&(null==r.align&&(r.align=!1),n.indented=e.indentation(),n.startOfLine=!0),e.eatSpace())return null;t=null;var i=(n.tokenize||l)(e,n);if("comment"==i)return i;if(null==r.align&&(r.align=!0),";"!=t&&":"!=t&&","!=t||"statement"!=r.type)if("{"==t)A(n,e.column(),"}");else if("["==t)A(n,e.column(),"]");else if("("==t)A(n,e.column(),")");else if("}"==t){for(;"statement"==r.type;)r=N(n);for("}"==r.type&&(r=N(n));"statement"==r.type;)r=N(n);}else t==r.type?N(n):u&&(("}"==r.type||"top"==r.type)&&";"!=t||"statement"==r.type&&"newstatement"==t)&&A(n,e.column(),"statement");else N(n);return n.startOfLine=!1,i},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:"--"}}}}

export { asn1 };
