import{A as E}from"./index.f4d41e67.entry.js";var U={exports:{}};(function(I,R){(function(g){g(E.exports)})(function(g){g.defineSimpleMode=function(t,o){g.defineMode(t,function(n){return g.simpleMode(n,o)})},g.simpleMode=function(t,o){x(o,"start");var n={},e=o.meta||{},f=!1;for(var r in o)if(r!=e&&o.hasOwnProperty(r))for(var a=n[r]=[],u=o[r],d=0;d<u.length;d++){var i=u[d];a.push(new k(i,o)),(i.indent||i.dedent)&&(f=!0)}var p={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:f?[]:null}},copyState:function(l){var h={state:l.state,pending:l.pending,local:l.local,localState:null,indent:l.indent&&l.indent.slice(0)};l.localState&&(h.localState=g.copyState(l.local.mode,l.localState)),l.stack&&(h.stack=l.stack.slice(0));for(var S=l.persistentStates;S;S=S.next)h.persistentStates={mode:S.mode,spec:S.spec,state:S.state==l.localState?h.localState:g.copyState(S.mode,S.state),next:h.persistentStates};return h},token:m(n,t),innerMode:function(l){return l.local&&{mode:l.local.mode,state:l.localState}},indent:P(n,e)};if(e)for(var c in e)e.hasOwnProperty(c)&&(p[c]=e[c]);return p};function x(t,o){if(!t.hasOwnProperty(o))throw new Error("Undefined state "+o+" in simple mode")}function s(t,o){if(!t)return/(?:)/;var n="";return t instanceof RegExp?(t.ignoreCase&&(n="i"),t.unicode&&(n+="u"),t=t.source):t=String(t),new RegExp((o===!1?"":"^")+"(?:"+t+")",n)}function y(t){if(!t)return null;if(t.apply)return t;if(typeof t=="string")return t.replace(/\./g," ");for(var o=[],n=0;n<t.length;n++)o.push(t[n]&&t[n].replace(/\./g," "));return o}function k(t,o){(t.next||t.push)&&x(o,t.next||t.push),this.regex=s(t.regex),this.token=y(t.token),this.data=t}function m(t,o){return function(n,e){if(e.pending){var f=e.pending.shift();return e.pending.length==0&&(e.pending=null),n.pos+=f.text.length,f.token}if(e.local)if(e.local.end&&n.match(e.local.end)){var r=e.local.endToken||null;return e.local=e.localState=null,r}else{var r=e.local.mode.token(n,e.localState),a;return e.local.endScan&&(a=e.local.endScan.exec(n.current()))&&(n.pos=n.start+a.index),r}for(var u=t[e.state],d=0;d<u.length;d++){var i=u[d],p=(!i.data.sol||n.sol())&&n.match(i.regex);if(p){i.data.next?e.state=i.data.next:i.data.push?((e.stack||(e.stack=[])).push(e.state),e.state=i.data.push):i.data.pop&&e.stack&&e.stack.length&&(e.state=e.stack.pop()),i.data.mode&&w(o,e,i.data.mode,i.token),i.data.indent&&e.indent.push(n.indentation()+o.indentUnit),i.data.dedent&&e.indent.pop();var c=i.token;if(c&&c.apply&&(c=c(p)),p.length>2&&i.token&&typeof i.token!="string"){for(var l=2;l<p.length;l++)p[l]&&(e.pending||(e.pending=[])).push({text:p[l],token:i.token[l-1]});return n.backUp(p[0].length-(p[1]?p[1].length:0)),c[0]}else return c&&c.join?c[0]:c}}return n.next(),null}}function v(t,o){if(t===o)return!0;if(!t||typeof t!="object"||!o||typeof o!="object")return!1;var n=0;for(var e in t)if(t.hasOwnProperty(e)){if(!o.hasOwnProperty(e)||!v(t[e],o[e]))return!1;n++}for(var e in o)o.hasOwnProperty(e)&&n--;return n==0}function w(t,o,n,e){var f;if(n.persistent)for(var r=o.persistentStates;r&&!f;r=r.next)(n.spec?v(n.spec,r.spec):n.mode==r.mode)&&(f=r);var a=f?f.mode:n.mode||g.getMode(t,n.spec),u=f?f.state:g.startState(a);n.persistent&&!f&&(o.persistentStates={mode:a,spec:n.spec,state:u,next:o.persistentStates}),o.localState=u,o.local={mode:a,end:n.end&&s(n.end),endScan:n.end&&n.forceEnd!==!1&&s(n.end,!1),endToken:e&&e.join?e[e.length-1]:e}}function O(t,o){for(var n=0;n<o.length;n++)if(o[n]===t)return!0}function P(t,o){return function(n,e,f){if(n.local&&n.local.mode.indent)return n.local.mode.indent(n.localState,e,f);if(n.indent==null||n.local||o.dontIndentStates&&O(n.state,o.dontIndentStates)>-1)return g.Pass;var r=n.indent.length-1,a=t[n.state];n:for(;;){for(var u=0;u<a.length;u++){var d=a[u];if(d.data.dedent&&d.data.dedentIfLineStart!==!1){var i=d.regex.exec(e);if(i&&i[0]){r--,(d.next||d.push)&&(a=t[d.next||d.push]),e=e.slice(i[0].length);continue n}}}break}return r<0?0:n.indent[r]}}})})();export{U as s};
