File: /var/www/html/wp-content/plugins/wp-graphql/build/627.js
"use strict";(globalThis.webpackChunk_wpgraphql_wp_graphql=globalThis.webpackChunk_wpgraphql_wp_graphql||[]).push([[627],{4601(e,t,n){n.d(t,{C:()=>a,P:()=>o,R:()=>s});var i=Object.defineProperty,r=(e,t)=>i(e,"name",{value:t,configurable:!0});class a{constructor(e){this.getStartOfToken=()=>this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>0===this._pos,this.peek=()=>this._sourceText.charAt(this._pos)?this._sourceText.charAt(this._pos):null,this.next=()=>{const e=this._sourceText.charAt(this._pos);return this._pos++,e},this.eat=e=>{if(this._testNextCharacter(e))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=e=>{let t=this._testNextCharacter(e),n=!1;for(t&&(n=t,this._start=this._pos);t;)this._pos++,t=this._testNextCharacter(e),n=!0;return n},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=e=>{this._pos=e},this.match=(e,t=!0,n=!1)=>{let i=null,r=null;return"string"==typeof e?(r=new RegExp(e,n?"i":"g").test(this._sourceText.substr(this._pos,e.length)),i=e):e instanceof RegExp&&(r=this._sourceText.slice(this._pos).match(e),i=null==r?void 0:r[0]),!(null==r||!("string"==typeof e||r instanceof Array&&this._sourceText.startsWith(r[0],this._pos)))&&(t&&(this._start=this._pos,i&&i.length&&(this._pos+=i.length)),r)},this.backUp=e=>{this._pos-=e},this.column=()=>this._pos,this.indentation=()=>{const e=this._sourceText.match(/\s*/);let t=0;if(e&&0!==e.length){const n=e[0];let i=0;for(;n.length>i;)9===n.charCodeAt(i)?t+=2:t++,i++}return t},this.current=()=>this._sourceText.slice(this._start,this._pos),this._start=0,this._pos=0,this._sourceText=e}_testNextCharacter(e){const t=this._sourceText.charAt(this._pos);let n=!1;return n="string"==typeof e?t===e:e instanceof RegExp?e.test(t):e(t),n}}r(a,"CharacterStream");class s{constructor(e,t){this.containsPosition=e=>this.start.line===e.line?this.start.character<=e.character:this.end.line===e.line?this.end.character>=e.character:this.start.line<=e.line&&this.end.line>=e.line,this.start=e,this.end=t}setStart(e,t){this.start=new o(e,t)}setEnd(e,t){this.end=new o(e,t)}}r(s,"Range");class o{constructor(e,t){this.lessThanOrEqualTo=e=>this.line<e.line||this.line===e.line&&this.character<=e.character,this.line=e,this.character=t}setLine(e){this.line=e}setCharacter(e){this.character=e}}r(o,"Position")},2627(e,t,n){n.r(t);var i=n(3338),r=(n(9669),n(5549)),a=n(166),s=n(4601),o=n(9920),l=n(7331),c=(n(1609),n(5795),Object.defineProperty),u=(e,t)=>c(e,"name",{value:t,configurable:!0});function p(e){let t;return f(e,e=>{switch(e.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":t=e}}),t}function d(e,t,n){return n===l.S.name&&e.getQueryType()===t?l.S:n===l.T.name&&e.getQueryType()===t?l.T:n===l.a.name&&(0,r.isCompositeType)(t)?l.a:"getFields"in t?t.getFields()[n]:null}function f(e,t){const n=[];let i=e;for(;null==i?void 0:i.kind;)n.push(i),i=i.prevState;for(let e=n.length-1;e>=0;e--)t(n[e])}function h(e){const t=Object.keys(e),n=t.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=e[t[r]];return i}function T(e,t){return v(t,m(e.string))}function v(e,t){return t?g(g(e.map(e=>({proximity:E(m(e.label),t),entry:e})),e=>e.proximity<=2),e=>!e.entry.isDeprecated).sort((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.label.length-t.entry.label.length).map(e=>e.entry):g(e,e=>!e.isDeprecated)}function g(e,t){const n=e.filter(t);return 0===n.length?e:n}function m(e){return e.toLowerCase().replace(/\W/g,"")}function E(e,t){let n=y(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}function y(e,t){let n,i;const r=[],a=e.length,s=t.length;for(n=0;n<=a;n++)r[n]=[n];for(i=1;i<=s;i++)r[0][i]=i;for(n=1;n<=a;n++)for(i=1;i<=s;i++){const a=e[n-1]===t[i-1]?0:1;r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+a),n>1&&i>1&&e[n-1]===t[i-2]&&e[n-2]===t[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+a))}return r[a][s]}u(p,"getDefinitionState"),u(d,"getFieldDef"),u(f,"forEachState"),u(h,"objectValues"),u(T,"hintList"),u(v,"filterAndSortList"),u(g,"filterNonEmpty"),u(m,"normalizeText"),u(E,"getProximity"),u(y,"lexicalDistance");const R={command:"editor.action.triggerSuggest",title:"Suggestions"},S=u(e=>{const t=[];if(e)try{(0,r.visit)((0,r.parse)(e),{FragmentDefinition(e){t.push(e)}})}catch(e){return[]}return t},"collectFragmentDefs");function D(e,t,n,i,s,o){var l;const c=Object.assign(Object.assign({},o),{schema:e}),u=i||P(t,n),p="Invalid"===u.state.kind?u.state.prevState:u.state;if(!p)return[];const d=p.kind,f=p.step,v=w(e,u.state);if(d===a.R.DOCUMENT)return T(u,[{label:"query",kind:a.C.Function},{label:"mutation",kind:a.C.Function},{label:"subscription",kind:a.C.Function},{label:"fragment",kind:a.C.Function},{label:"{",kind:a.C.Constructor}]);if(d===a.R.IMPLEMENTS||d===a.R.NAMED_TYPE&&(null===(l=p.prevState)||void 0===l?void 0:l.kind)===a.R.IMPLEMENTS)return L(u,p,e,t,v);if(d===a.R.SELECTION_SET||d===a.R.FIELD||d===a.R.ALIASED_FIELD)return N(u,v,c);if(d===a.R.ARGUMENTS||d===a.R.ARGUMENT&&0===f){const e=v.argDefs;if(e)return T(u,e.map(e=>{var t;return{label:e.name,insertText:e.name+": ",command:R,detail:String(e.type),documentation:null!==(t=e.description)&&void 0!==t?t:void 0,kind:a.C.Variable,type:e.type}}))}if((d===a.R.OBJECT_VALUE||d===a.R.OBJECT_FIELD&&0===f)&&v.objectFieldDefs){const e=h(v.objectFieldDefs),t=d===a.R.OBJECT_VALUE?a.C.Value:a.C.Field;return T(u,e.map(e=>{var n;return{label:e.name,detail:String(e.type),documentation:null!==(n=e.description)&&void 0!==n?n:void 0,kind:t,type:e.type}}))}if(d===a.R.ENUM_VALUE||d===a.R.LIST_VALUE&&1===f||d===a.R.OBJECT_FIELD&&2===f||d===a.R.ARGUMENT&&2===f)return k(u,v,t,e);if(d===a.R.VARIABLE&&1===f){const n=(0,r.getNamedType)(v.inputType);return T(u,F(t,e,u).filter(e=>e.detail===(null==n?void 0:n.name)))}return d===a.R.TYPE_CONDITION&&1===f||d===a.R.NAMED_TYPE&&null!=p.prevState&&p.prevState.kind===a.R.TYPE_CONDITION?A(u,v,e):d===a.R.FRAGMENT_SPREAD&&1===f?C(u,v,e,t,Array.isArray(s)?s:S(s)):d===a.R.VARIABLE_DEFINITION&&2===f||d===a.R.LIST_TYPE&&1===f||d===a.R.NAMED_TYPE&&p.prevState&&(p.prevState.kind===a.R.VARIABLE_DEFINITION||p.prevState.kind===a.R.LIST_TYPE||p.prevState.kind===a.R.NON_NULL_TYPE)?M(u,e):d===a.R.DIRECTIVE?x(u,p,e):[]}u(D,"getAutocompleteSuggestions");const I=" {\n $1\n}",_=u(e=>{const t=e.type;if((0,r.isCompositeType)(t))return I;if((0,r.isListType)(t)&&(0,r.isCompositeType)(t.ofType))return I;if((0,r.isNonNullType)(t)){if((0,r.isCompositeType)(t.ofType))return I;if((0,r.isListType)(t.ofType)&&(0,r.isCompositeType)(t.ofType.ofType))return I}return null},"getInsertText");function N(e,t,n){var i;if(t.parentType){const s=t.parentType;let o=[];return"getFields"in s&&(o=h(s.getFields())),(0,r.isCompositeType)(s)&&o.push(r.TypeNameMetaFieldDef),s===(null===(i=null==n?void 0:n.schema)||void 0===i?void 0:i.getQueryType())&&o.push(r.SchemaMetaFieldDef,r.TypeMetaFieldDef),T(e,o.map((e,t)=>{var n;const i={sortText:String(t)+e.name,label:e.name,detail:String(e.type),documentation:null!==(n=e.description)&&void 0!==n?n:void 0,deprecated:Boolean(e.deprecationReason),isDeprecated:Boolean(e.deprecationReason),deprecationReason:e.deprecationReason,kind:a.C.Field,type:e.type},r=_(e);return r&&(i.insertText=e.name+r,i.insertTextFormat=a.I.Snippet,i.command=R),i}))}return[]}function k(e,t,n,i){const s=(0,r.getNamedType)(t.inputType),o=F(n,i,e).filter(e=>e.detail===s.name);return s instanceof r.GraphQLEnumType?T(e,s.getValues().map(e=>{var t;return{label:e.name,detail:String(s),documentation:null!==(t=e.description)&&void 0!==t?t:void 0,deprecated:Boolean(e.deprecationReason),isDeprecated:Boolean(e.deprecationReason),deprecationReason:e.deprecationReason,kind:a.C.EnumMember,type:s}}).concat(o)):s===r.GraphQLBoolean?T(e,o.concat([{label:"true",detail:String(r.GraphQLBoolean),documentation:"Not false.",kind:a.C.Variable,type:r.GraphQLBoolean},{label:"false",detail:String(r.GraphQLBoolean),documentation:"Not true.",kind:a.C.Variable,type:r.GraphQLBoolean}])):o}function L(e,t,n,i,s){if(t.needsSeparator)return[];const o=h(n.getTypeMap()).filter(r.isInterfaceType),l=o.map(({name:e})=>e),c=new Set;U(i,(e,t)=>{var i,o,u,p,d;if(t.name&&(t.kind!==a.R.INTERFACE_DEF||l.includes(t.name)||c.add(t.name),t.kind===a.R.NAMED_TYPE&&(null===(i=t.prevState)||void 0===i?void 0:i.kind)===a.R.IMPLEMENTS))if(s.interfaceDef){if(null===(o=s.interfaceDef)||void 0===o?void 0:o.getInterfaces().find(({name:e})=>e===t.name))return;const e=n.getType(t.name),i=null===(u=s.interfaceDef)||void 0===u?void 0:u.toConfig();s.interfaceDef=new r.GraphQLInterfaceType(Object.assign(Object.assign({},i),{interfaces:[...i.interfaces,e||new r.GraphQLInterfaceType({name:t.name,fields:{}})]}))}else if(s.objectTypeDef){if(null===(p=s.objectTypeDef)||void 0===p?void 0:p.getInterfaces().find(({name:e})=>e===t.name))return;const e=n.getType(t.name),i=null===(d=s.objectTypeDef)||void 0===d?void 0:d.toConfig();s.objectTypeDef=new r.GraphQLObjectType(Object.assign(Object.assign({},i),{interfaces:[...i.interfaces,e||new r.GraphQLInterfaceType({name:t.name,fields:{}})]}))}});const u=s.interfaceDef||s.objectTypeDef,p=((null==u?void 0:u.getInterfaces())||[]).map(({name:e})=>e);return T(e,o.concat([...c].map(e=>({name:e}))).filter(({name:e})=>e!==(null==u?void 0:u.name)&&!p.includes(e)).map(e=>{const t={label:e.name,kind:a.C.Interface,type:e};return(null==e?void 0:e.description)&&(t.documentation=e.description),t}))}function A(e,t,n,i){let s;if(t.parentType)if((0,r.isAbstractType)(t.parentType)){const e=(0,r.assertAbstractType)(t.parentType),i=n.getPossibleTypes(e),a=Object.create(null);i.forEach(e=>{e.getInterfaces().forEach(e=>{a[e.name]=e})}),s=i.concat(h(a))}else s=[t.parentType];else s=h(n.getTypeMap()).filter(r.isCompositeType);return T(e,s.map(e=>{const t=(0,r.getNamedType)(e);return{label:String(e),documentation:(null==t?void 0:t.description)||"",kind:a.C.Field}}))}function C(e,t,n,i,s){if(!i)return[];const o=n.getTypeMap(),l=p(e.state),c=O(i);return s&&s.length>0&&c.push(...s),T(e,c.filter(e=>o[e.typeCondition.name.value]&&!(l&&l.kind===a.R.FRAGMENT_DEFINITION&&l.name===e.name.value)&&(0,r.isCompositeType)(t.parentType)&&(0,r.isCompositeType)(o[e.typeCondition.name.value])&&(0,r.doTypesOverlap)(n,t.parentType,o[e.typeCondition.name.value])).map(e=>({label:e.name.value,detail:String(o[e.typeCondition.name.value]),documentation:`fragment ${e.name.value} on ${e.typeCondition.name.value}`,kind:a.C.Field,type:o[e.typeCondition.name.value]})))}u(N,"getSuggestionsForFieldNames"),u(k,"getSuggestionsForInputValues"),u(L,"getSuggestionsForImplements"),u(A,"getSuggestionsForFragmentTypeConditions"),u(C,"getSuggestionsForFragmentSpread");const b=u((e,t)=>{var n,i,r,a,s,o,l,c,u,p;return(null===(n=e.prevState)||void 0===n?void 0:n.kind)===t?e.prevState:(null===(r=null===(i=e.prevState)||void 0===i?void 0:i.prevState)||void 0===r?void 0:r.kind)===t?e.prevState.prevState:(null===(o=null===(s=null===(a=e.prevState)||void 0===a?void 0:a.prevState)||void 0===s?void 0:s.prevState)||void 0===o?void 0:o.kind)===t?e.prevState.prevState.prevState:(null===(p=null===(u=null===(c=null===(l=e.prevState)||void 0===l?void 0:l.prevState)||void 0===c?void 0:c.prevState)||void 0===u?void 0:u.prevState)||void 0===p?void 0:p.kind)===t?e.prevState.prevState.prevState.prevState:void 0},"getParentDefinition");function F(e,t,n){let i,r=null;const s=Object.create({});return U(e,(e,o)=>{if((null==o?void 0:o.kind)===a.R.VARIABLE&&o.name&&(r=o.name),(null==o?void 0:o.kind)===a.R.NAMED_TYPE&&r){const e=b(o,a.R.TYPE);(null==e?void 0:e.type)&&(i=t.getType(null==e?void 0:e.type))}r&&i&&(s[r]||(s[r]={detail:i.toString(),insertText:"$"===n.string?r:"$"+r,label:r,type:i,kind:a.C.Variable},r=null,i=null))}),h(s)}function O(e){const t=[];return U(e,(e,n)=>{n.kind===a.R.FRAGMENT_DEFINITION&&n.name&&n.type&&t.push({kind:a.R.FRAGMENT_DEFINITION,name:{kind:r.Kind.NAME,value:n.name},selectionSet:{kind:a.R.SELECTION_SET,selections:[]},typeCondition:{kind:a.R.NAMED_TYPE,name:{kind:r.Kind.NAME,value:n.type}}})}),t}function M(e,t,n){return T(e,h(t.getTypeMap()).filter(r.isInputType).map(e=>({label:e.name,documentation:e.description,kind:a.C.Variable})))}function x(e,t,n,i){var r;return(null===(r=t.prevState)||void 0===r?void 0:r.kind)?T(e,n.getDirectives().filter(e=>G(t.prevState,e)).map(e=>({label:e.name,documentation:e.description||"",kind:a.C.Function}))):[]}function P(e,t){let n=null,i=null,r=null;const a=U(e,(e,a,s,o)=>{if(o===t.line&&e.getCurrentPosition()>=t.character)return n=s,i=Object.assign({},a),r=e.current(),"BREAK"});return{start:a.start,end:a.end,string:r||a.string,state:i||a.state,style:n||a.style}}function U(e,t){const n=e.split("\n"),i=(0,o.o)();let r=i.startState(),a="",l=new s.C("");for(let e=0;e<n.length;e++){for(l=new s.C(n[e]);!l.eol()&&(a=i.token(l,r),"BREAK"!==t(l,r,a,e)););t(l,r,a,e),r.kind||(r=i.startState())}return{start:l.getStartOfToken(),end:l.getCurrentPosition(),string:l.current(),state:r,style:a}}function G(e,t){var n;if(!e||!e.kind)return!1;const i=e.kind,s=t.locations;switch(i){case a.R.QUERY:return-1!==s.indexOf(r.DirectiveLocation.QUERY);case a.R.MUTATION:return-1!==s.indexOf(r.DirectiveLocation.MUTATION);case a.R.SUBSCRIPTION:return-1!==s.indexOf(r.DirectiveLocation.SUBSCRIPTION);case a.R.FIELD:case a.R.ALIASED_FIELD:return-1!==s.indexOf(r.DirectiveLocation.FIELD);case a.R.FRAGMENT_DEFINITION:return-1!==s.indexOf(r.DirectiveLocation.FRAGMENT_DEFINITION);case a.R.FRAGMENT_SPREAD:return-1!==s.indexOf(r.DirectiveLocation.FRAGMENT_SPREAD);case a.R.INLINE_FRAGMENT:return-1!==s.indexOf(r.DirectiveLocation.INLINE_FRAGMENT);case a.R.SCHEMA_DEF:return-1!==s.indexOf(r.DirectiveLocation.SCHEMA);case a.R.SCALAR_DEF:return-1!==s.indexOf(r.DirectiveLocation.SCALAR);case a.R.OBJECT_TYPE_DEF:return-1!==s.indexOf(r.DirectiveLocation.OBJECT);case a.R.FIELD_DEF:return-1!==s.indexOf(r.DirectiveLocation.FIELD_DEFINITION);case a.R.INTERFACE_DEF:return-1!==s.indexOf(r.DirectiveLocation.INTERFACE);case a.R.UNION_DEF:return-1!==s.indexOf(r.DirectiveLocation.UNION);case a.R.ENUM_DEF:return-1!==s.indexOf(r.DirectiveLocation.ENUM);case a.R.ENUM_VALUE:return-1!==s.indexOf(r.DirectiveLocation.ENUM_VALUE);case a.R.INPUT_DEF:return-1!==s.indexOf(r.DirectiveLocation.INPUT_OBJECT);case a.R.INPUT_VALUE_DEF:switch(null===(n=e.prevState)||void 0===n?void 0:n.kind){case a.R.ARGUMENTS_DEF:return-1!==s.indexOf(r.DirectiveLocation.ARGUMENT_DEFINITION);case a.R.INPUT_DEF:return-1!==s.indexOf(r.DirectiveLocation.INPUT_FIELD_DEFINITION)}}return!1}function w(e,t){let n,i,s,o,l,c,u,p,h,T,v;return f(t,t=>{var f;switch(t.kind){case a.R.QUERY:case"ShortQuery":T=e.getQueryType();break;case a.R.MUTATION:T=e.getMutationType();break;case a.R.SUBSCRIPTION:T=e.getSubscriptionType();break;case a.R.INLINE_FRAGMENT:case a.R.FRAGMENT_DEFINITION:t.type&&(T=e.getType(t.type));break;case a.R.FIELD:case a.R.ALIASED_FIELD:T&&t.name?(l=h?d(e,h,t.name):null,T=l?l.type:null):l=null;break;case a.R.SELECTION_SET:h=(0,r.getNamedType)(T);break;case a.R.DIRECTIVE:s=t.name?e.getDirective(t.name):null;break;case a.R.INTERFACE_DEF:t.name&&(u=null,v=new r.GraphQLInterfaceType({name:t.name,interfaces:[],fields:{}}));break;case a.R.OBJECT_TYPE_DEF:t.name&&(v=null,u=new r.GraphQLObjectType({name:t.name,interfaces:[],fields:{}}));break;case a.R.ARGUMENTS:if(t.prevState)switch(t.prevState.kind){case a.R.FIELD:i=l&&l.args;break;case a.R.DIRECTIVE:i=s&&s.args;break;case a.R.ALIASED_FIELD:{const n=null===(f=t.prevState)||void 0===f?void 0:f.name;if(!n){i=null;break}const r=h?d(e,h,n):null;if(!r){i=null;break}i=r.args;break}default:i=null}else i=null;break;case a.R.ARGUMENT:if(i)for(let e=0;e<i.length;e++)if(i[e].name===t.name){n=i[e];break}c=null==n?void 0:n.type;break;case a.R.ENUM_VALUE:const g=(0,r.getNamedType)(c);o=g instanceof r.GraphQLEnumType?g.getValues().find(e=>e.value===t.name):null;break;case a.R.LIST_VALUE:const m=(0,r.getNullableType)(c);c=m instanceof r.GraphQLList?m.ofType:null;break;case a.R.OBJECT_VALUE:const E=(0,r.getNamedType)(c);p=E instanceof r.GraphQLInputObjectType?E.getFields():null;break;case a.R.OBJECT_FIELD:const y=t.name&&p?p[t.name]:null;c=null==y?void 0:y.type;break;case a.R.NAMED_TYPE:t.name&&(T=e.getType(t.name))}}),{argDef:n,argDefs:i,directiveDef:s,enumValue:o,fieldDef:l,inputType:c,objectFieldDefs:p,parentType:h,type:T,interfaceDef:v,objectTypeDef:u}}u(F,"getVariableCompletions"),u(O,"getFragmentDefinitions"),u(M,"getSuggestionsForVariableDefinition"),u(x,"getSuggestionsForDirective"),u(P,"getTokenAtPosition"),u(U,"runOnlineParser"),u(G,"canUseDirective"),u(w,"getTypeInfo"),i.C.registerHelper("hint","graphql",(e,t)=>{const n=t.schema;if(!n)return;const r=e.getCursor(),a=e.getTokenAt(r),o=null!==a.type&&/"|\w/.test(a.string[0])?a.start:a.end,l=new s.P(r.line,o),c={list:D(n,e.getValue(),l,a,t.externalFragments).map(e=>({text:e.label,type:e.type,description:e.documentation,isDeprecated:e.isDeprecated,deprecationReason:e.deprecationReason})),from:{line:r.line,ch:o},to:{line:r.line,ch:a.end}};return(null==c?void 0:c.list)&&c.list.length>0&&(c.from=i.C.Pos(c.from.line,c.from.ch),c.to=i.C.Pos(c.to.line,c.to.ch),i.C.signal(e,"hasCompletion",e,c,a)),c})},9920(e,t,n){n.d(t,{o:()=>o});var i=n(166),r=n(5549),a=Object.defineProperty,s=(e,t)=>a(e,"name",{value:t,configurable:!0});function o(e={eatWhitespace:e=>e.eatWhile(i.i),lexRules:i.L,parseRules:i.P,editorConfig:{}}){return{startState(){const t={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return p(e.parseRules,t,r.Kind.DOCUMENT),t},token:(t,n)=>l(t,n,e)}}function l(e,t,n){var i;if(t.inBlockstring)return e.match(/.*"""/)?(t.inBlockstring=!1,"string"):(e.skipToEnd(),"string");const{lexRules:r,parseRules:a,eatWhitespace:s,editorConfig:o}=n;if(t.rule&&0===t.rule.length?d(t):t.needsAdvance&&(t.needsAdvance=!1,f(t,!0)),e.sol()){const n=(null==o?void 0:o.tabSize)||2;t.indentLevel=Math.floor(e.indentation()/n)}if(s(e))return"ws";const l=v(r,e);if(!l)return e.match(/\S+/)||e.match(/\s/),p(u,t,"Invalid"),"invalidchar";if("Comment"===l.kind)return p(u,t,"Comment"),"comment";const h=c({},t);if("Punctuation"===l.kind)if(/^[{([]/.test(l.value))void 0!==t.indentLevel&&(t.levels=(t.levels||[]).concat(t.indentLevel+1));else if(/^[})\]]/.test(l.value)){const e=t.levels=(t.levels||[]).slice(0,-1);t.indentLevel&&e.length>0&&e[e.length-1]<t.indentLevel&&(t.indentLevel=e[e.length-1])}for(;t.rule;){let n="function"==typeof t.rule?0===t.step?t.rule(l,e):null:t.rule[t.step];if(t.needsSeparator&&(n=null==n?void 0:n.separator),n){if(n.ofRule&&(n=n.ofRule),"string"==typeof n){p(a,t,n);continue}if(null===(i=n.match)||void 0===i?void 0:i.call(n,l))return n.update&&n.update(t,l),"Punctuation"===l.kind?f(t,!0):t.needsAdvance=!0,n.style}T(t)}return c(t,h),p(u,t,"Invalid"),"invalidchar"}function c(e,t){const n=Object.keys(t);for(let i=0;i<n.length;i++)e[n[i]]=t[n[i]];return e}s(o,"onlineParser"),s(l,"getToken"),s(c,"assign");const u={Invalid:[],Comment:[]};function p(e,t,n){if(!e[n])throw new TypeError("Unknown rule: "+n);t.prevState=Object.assign({},t),t.kind=n,t.name=null,t.type=null,t.rule=e[n],t.step=0,t.needsSeparator=!1}function d(e){e.prevState&&(e.kind=e.prevState.kind,e.name=e.prevState.name,e.type=e.prevState.type,e.rule=e.prevState.rule,e.step=e.prevState.step,e.needsSeparator=e.prevState.needsSeparator,e.prevState=e.prevState.prevState)}function f(e,t){var n;if(h(e)&&e.rule){const n=e.rule[e.step];if(n.separator){const t=n.separator;if(e.needsSeparator=!e.needsSeparator,!e.needsSeparator&&t.ofRule)return}if(t)return}for(e.needsSeparator=!1,e.step++;e.rule&&!(Array.isArray(e.rule)&&e.step<e.rule.length);)d(e),e.rule&&(h(e)?(null===(n=e.rule)||void 0===n?void 0:n[e.step].separator)&&(e.needsSeparator=!e.needsSeparator):(e.needsSeparator=!1,e.step++))}function h(e){const t=Array.isArray(e.rule)&&"string"!=typeof e.rule[e.step]&&e.rule[e.step];return t&&t.isList}function T(e){for(;e.rule&&(!Array.isArray(e.rule)||!e.rule[e.step].ofRule);)d(e);e.rule&&f(e,!1)}function v(e,t){const n=Object.keys(e);for(let i=0;i<n.length;i++){const r=t.match(e[n[i]]);if(r&&r instanceof Array)return{kind:n[i],value:r[0]}}}s(p,"pushRule"),s(d,"popRule"),s(f,"advanceRule"),s(h,"isList"),s(T,"unsuccessful"),s(v,"lex")}}]);