import {
  a as t,
  c as H
} from "./chunk-IO47FP3U.js";

// ../node_modules/highlight.js/lib/languages/htmlbars.js
var f = H((B, m) => {
  function S(e) {
    return e ? typeof e == "string" ? e : e.source : null;
  }
  t(S, "source");
  function P(e) {
    return i("(", e, ")*");
  }
  t(P, "anyNumberOfTimes");
  function M(e) {
    return i("(", e, ")?");
  }
  t(M, "optional");
  function i(...e) {
    return e.map((a) => S(a)).join("");
  }
  t(i, "concat");
  function L(...e) {
    return "(" + e.map((a) => S(a)).join("|") + ")";
  }
  t(L, "either");
  function p(e) {
    let n = {
      "builtin-name": [
        "action",
        "bindattr",
        "collection",
        "component",
        "concat",
        "debugger",
        "each",
        "each-in",
        "get",
        "hash",
        "if",
        "in",
        "input",
        "link-to",
        "loc",
        "log",
        "lookup",
        "mut",
        "outlet",
        "partial",
        "query-params",
        "render",
        "template",
        "textarea",
        "unbound",
        "unless",
        "view",
        "with",
        "yield"
      ]
    }, a = {
      literal: [
        "true",
        "false",
        "undefined",
        "null"
      ]
    }, T = /""|"[^"]+"/, A = /''|'[^']+'/, r = /\[\]|\[[^\]]+\]/, c = /[^\s!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/, R = /(\.|\/)/, _ = L(
      T,
      A,
      r,
      c
    ), b = i(
      M(/\.|\.\/|\//),
      // relative or absolute path
      _,
      P(i(
        R,
        _
      ))
    ), g = i(
      "(",
      r,
      "|",
      c,
      ")(?==)"
    ), s = {
      begin: b,
      lexemes: /[\w.\/]+/
    }, N = e.inherit(s, {
      keywords: a
    }), E = {
      begin: /\(/,
      end: /\)/
      // the "contains" is added below when all necessary sub-modes are defined
    }, I = {
      // fka "attribute-assignment", parameters of the form 'key=value'
      className: "attr",
      begin: g,
      relevance: 0,
      starts: {
        begin: /=/,
        end: /=/,
        starts: {
          contains: [
            e.NUMBER_MODE,
            e.QUOTE_STRING_MODE,
            e.APOS_STRING_MODE,
            N,
            E
          ]
        }
      }
    }, O = {
      // parameters of the form '{{#with x as | y |}}...{{/with}}'
      begin: /as\s+\|/,
      keywords: {
        keyword: "as"
      },
      end: /\|/,
      contains: [
        {
          // define sub-mode in order to prevent highlighting of block-parameter named "as"
          begin: /\w+/
        }
      ]
    }, o = {
      contains: [
        e.NUMBER_MODE,
        e.QUOTE_STRING_MODE,
        e.APOS_STRING_MODE,
        O,
        I,
        N,
        E
      ],
      returnEnd: !0
      // the property "end" is defined through inheritance when the mode is used. If depends
      // on the surrounding mode, but "endsWithParent" does not work here (i.e. it includes the
      // end-token of the surrounding mode)
    }, C = e.inherit(s, {
      className: "name",
      keywords: n,
      starts: e.inherit(o, {
        end: /\)/
      })
    });
    E.contains = [C];
    let u = e.inherit(s, {
      keywords: n,
      className: "name",
      starts: e.inherit(o, {
        end: /\}\}/
      })
    }), l = e.inherit(s, {
      keywords: n,
      className: "name"
    }), d = e.inherit(s, {
      className: "name",
      keywords: n,
      starts: e.inherit(o, {
        end: /\}\}/
      })
    });
    return {
      name: "Handlebars",
      aliases: [
        "hbs",
        "html.hbs",
        "html.handlebars",
        "htmlbars"
      ],
      case_insensitive: !0,
      subLanguage: "xml",
      contains: [
        {
          begin: /\\\{\{/,
          skip: !0
        },
        {
          begin: /\\\\(?=\{\{)/,
          skip: !0
        },
        e.COMMENT(/\{\{!--/, /--\}\}/),
        e.COMMENT(/\{\{!/, /\}\}/),
        {
          // open raw block "{{{{raw}}}} content not evaluated {{{{/raw}}}}"
          className: "template-tag",
          begin: /\{\{\{\{(?!\/)/,
          end: /\}\}\}\}/,
          contains: [u],
          starts: {
            end: /\{\{\{\{\//,
            returnEnd: !0,
            subLanguage: "xml"
          }
        },
        {
          // close raw block
          className: "template-tag",
          begin: /\{\{\{\{\//,
          end: /\}\}\}\}/,
          contains: [l]
        },
        {
          // open block statement
          className: "template-tag",
          begin: /\{\{#/,
          end: /\}\}/,
          contains: [u]
        },
        {
          className: "template-tag",
          begin: /\{\{(?=else\}\})/,
          end: /\}\}/,
          keywords: "else"
        },
        {
          className: "template-tag",
          begin: /\{\{(?=else if)/,
          end: /\}\}/,
          keywords: "else if"
        },
        {
          // closing block statement
          className: "template-tag",
          begin: /\{\{\//,
          end: /\}\}/,
          contains: [l]
        },
        {
          // template variable or helper-call that is NOT html-escaped
          className: "template-variable",
          begin: /\{\{\{/,
          end: /\}\}\}/,
          contains: [d]
        },
        {
          // template variable or helper-call that is html-escaped
          className: "template-variable",
          begin: /\{\{/,
          end: /\}\}/,
          contains: [d]
        }
      ]
    };
  }
  t(p, "handlebars");
  function D(e) {
    let n = p(e);
    return n.name = "HTMLbars", e.getLanguage("handlebars") && (n.disableAutodetect = !0), n;
  }
  t(D, "htmlbars");
  m.exports = D;
});

export {
  f as a
};
