import { __require as s } from "./markup-templating.mjs";
import { __require as g } from "./php.mjs";
var n, u;
function h() {
  if (u)
    return n;
  u = 1;
  var l = s(), p = g();
  n = t, t.displayName = "latte", t.aliases = [];
  function t(r) {
    r.register(l), r.register(p), function(a) {
      a.languages.latte = {
        comment: /^\{\*[\s\S]*/,
        "latte-tag": {
          // https://latte.nette.org/en/tags
          pattern: /(^\{(?:\/(?=[a-z]))?)(?:[=_]|[a-z]\w*\b(?!\())/i,
          lookbehind: !0,
          alias: "important"
        },
        delimiter: {
          pattern: /^\{\/?|\}$/,
          alias: "punctuation"
        },
        php: {
          pattern: /\S(?:[\s\S]*\S)?/,
          alias: "language-php",
          inside: a.languages.php
        }
      };
      var i = a.languages.extend("markup", {});
      a.languages.insertBefore("inside", "attr-value", {
        "n-attr": {
          pattern: /n:[\w-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+))?/,
          inside: {
            "attr-name": {
              pattern: /^[^\s=]+/,
              alias: "important"
            },
            "attr-value": {
              pattern: /=[\s\S]+/,
              inside: {
                punctuation: [/^=/, {
                  pattern: /^(\s*)["']|["']$/,
                  lookbehind: !0
                }],
                php: {
                  pattern: /\S(?:[\s\S]*\S)?/,
                  inside: a.languages.php
                }
              }
            }
          }
        }
      }, i.tag), a.hooks.add("before-tokenize", function(e) {
        if (e.language === "latte") {
          var o = /\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/g;
          a.languages["markup-templating"].buildPlaceholders(e, "latte", o), e.grammar = i;
        }
      }), a.hooks.add("after-tokenize", function(e) {
        a.languages["markup-templating"].tokenizePlaceholders(e, "latte");
      });
    }(r);
  }
  return n;
}
export {
  h as __require
};
