import {
  a as g
} from "./chunk-BYYJ3QKW.js";
import {
  a as u
} from "./chunk-NDNECGXU.js";
import {
  a as l,
  c as s
} from "./chunk-IO47FP3U.js";

// ../node_modules/refractor/lang/latte.js
var c = s((h, i) => {
  var o = u(), d = g();
  i.exports = n;
  n.displayName = "latte";
  n.aliases = [];
  function n(e) {
    e.register(o), e.register(d), 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 r = 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
                  }
                }
              }
            }
          }
        },
        r.tag
      ), a.hooks.add("before-tokenize", function(t) {
        if (t.language === "latte") {
          var p = /\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/g;
          a.languages["markup-templating"].buildPlaceholders(
            t,
            "latte",
            p
          ), t.grammar = r;
        }
      }), a.hooks.add("after-tokenize", function(t) {
        a.languages["markup-templating"].tokenizePlaceholders(t, "latte");
      });
    }(e);
  }
  l(n, "latte");
});

export {
  c as a
};
